jackpf Posted April 3, 2009 Share Posted April 3, 2009 Hi all, I'm currently having a bit of a problem editing and deleting a cookie I set in javascript with php. I'm attempting to allow the user to update their cookie in real time or via php. But if the cookie is created with one language, it's not accessible in the other. Here's my javascript:: var post = $_GET('thread')+'.'+document.forms[0].post.value; //$_GET is my javascript emulation of PHP's superglobal var expire = new Date(); expire.setDate(expire.getDate() + 999); document.cookie = 'jackpf_post='+escape(post)+'; expires='+expire.toGMTString()+'; path=/; domain='+window.location.hostname; //tried all sorts of stuff here, like '.jackpf.co.uk', 'jackpf.co.uk', 'www.jackpf.co.uk', false, etc.... And PHP, simply:: setcookie('jackpf_post', false, -1000, '/', '.www.jackpf.co.uk'); //fails The cookie is definitely being set with the right values and stuff; I just can't modify it. Any help is greatly appreciated, Thanks, Jack. Link to comment https://forums.phpfreaks.com/topic/152453-deletingediting-cookie-set-in-javascript-with-php/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.