I'm using this javascript function to setup a cookie on my site that will show a div wile the cookie isn't setup.
function accept_cookies(){
days=365; // number of days to keep the cookie
myDate = new Date();
myDate.setTime(myDate.getTime()+(days*24*60*60*1000));
document.cookie = 'cookie_t=1; expires=' + myDate.toGMTString();
}
usage:
<a onClick="HideContent('cookies'); accept_cookies()" href="javascript:HideContent('cookies')">
ok
</a>
This method works great on my desktop device but, on my android phone it doesn't work so well. I know this because I click the link several times and the div keeps on showing after it the link saying that is ok.