Warrior Forum - The #1 Digital Marketing Forum & Marketplace

Warrior Forum - The #1 Digital Marketing Forum & Marketplace (https://www.warriorforum.com/)
-   Programming (https://www.warriorforum.com/programming/)
-   -   cookie compliance? any tips (java, css)? (https://www.warriorforum.com/programming/1117373-cookie-compliance-any-tips-java-css.html)

Arcsn 1st October 2015 03:24 AM

cookie compliance? any tips (java, css)?
 
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)? :D

wordpress+expert 1st October 2015 04:19 AM

Re: cookie compliance? any tips (java, css)?
 
Hi Arcsn)

Quote:

Originally Posted by Arcsn (Post 10308838)
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.


Quote:

Originally Posted by Arcsn (Post 10308838)
if not, which java is best according to you? (light and fast loading)? :D


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" );


Arcsn 1st October 2015 05:21 AM

Re: cookie compliance? any tips (java, css)?
 
perfect. i was suspecting that css only is not a solution.

I'll try to implement your code and see how is going...

Arcsn 13th October 2015 02:48 AM

Re: cookie compliance? any tips (java, css)?
 
unfortunately this script is not working... this code shows the cookie value as null and undefined. :smilies_confused:

will search for different one...


All times are GMT -6. The time now is 08:40 PM.