I set the cookie through the click event:
$("#myModal .modal-body a").click(function() {
document.cookie = 'town='+$(this).text()+'; path=/';
});
Everything works fine, but when I try to display this value in the html element the next day (if necessary):
<div>
<?=$_COOKIE['town']?>
</div>
In the browser, I get something like #A=0Gthis in this div. Firebug shows this value #A=0G, but the source data is correct town. What am I doing wrong?
source
share