Hi what is the code for javascript cookie to expire like 30 minutes from now? I tried the Date.setTime() function but it couldn't work.
ok i got it set up. anyway the cookie i set in javascript cannot be deleted in php. They both have the same name. Any idea what's wrong?
I'm not sure but I think that since PHP and javascript are different coding languages they might not use the same cookie names or folder. What are you trying to do exactly?
Nice joke. Cookie save in browsers (Internet Explorer, etc.) and don't depend from programing language. cloudnthunder, print here your javascript and php code.
var dt = new Date(), expiryTime = dt.setTime( dt.getTime() + 1800000 ); document.cookie = 'myCookie=' + myValue + ';expires=' + dt.toGMTString(); Code (markup):