cookie compliance? any tips (java, css)?

by Arcsn
3 replies
Hi guys,

i was wandering if there is any other way to write a cookie compliance code in css only?

i mean i found many tutorials, all using java... is there a css only one?

if not, which java is best according to you? (light and fast loading)?
#compliance #cookie #css #java #tips
  • Profile picture of the author wordpress+expert
    Hi Arcsn)

    Originally Posted by Arcsn View Post

    i was wandering if there is any other way to write a cookie compliance code in css only?

    i mean i found many tutorials, all using java... is there a css only one?
    CSS - Cascading Style Sheets. Therefore, using CSS can not change the cookies. You have to use php or js.


    Originally Posted by Arcsn View Post

    if not, which java is best according to you? (light and fast loading)?

    you can use this code:

    Code:
    function set_cookie ( name, value, exp_y, exp_m, exp_d, path, domain, secure )
    {
      var cookie_string = name + "=" + escape ( value );
     
      if ( exp_y )
      {
        var expires = new Date ( exp_y, exp_m, exp_d );
        cookie_string += "; expires=" + expires.toGMTString();
      }
     
      if ( path )
            cookie_string += "; path=" + escape ( path );
     
      if ( domain )
            cookie_string += "; domain=" + escape ( domain );
      
      if ( secure )
            cookie_string += "; secure";
      
      document.cookie = cookie_string;
    }
    
    set_cookie ( "key", "value" );
    {{ DiscussionBoard.errors[10308927].message }}
    • Profile picture of the author Arcsn
      perfect. i was suspecting that css only is not a solution.

      I'll try to implement your code and see how is going...
      {{ DiscussionBoard.errors[10309065].message }}
      • Profile picture of the author Arcsn
        unfortunately this script is not working... this code shows the cookie value as null and undefined.

        will search for different one...
        {{ DiscussionBoard.errors[10331717].message }}

Trending Topics