cookie compliance? any tips (java, css)?

by 3 replies
4
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)?
#programming #compliance #cookie #css #java #tips
  • Hi Arcsn)

    CSS - Cascading Style Sheets. Therefore, using CSS can not change the cookies. You have to use php or js.



    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" );
    • [ 1 ] Thanks
    • [1] reply
    • perfect. i was suspecting that css only is not a solution.

      I'll try to implement your code and see how is going...
      • [1] reply
  • [DELETED]

Next Topics on Trending Feed