informvarma Posted April 20, 2009 Share Posted April 20, 2009 Hello all, session level cookie in IE8 is not happening, any help in this regard is much appriciated. the following code works good in FF. But in IE it fails giving a higher life time makes it work in IE. But i need a session cookie setcookie('name', 'value', 0, '/', 'mydomain.com'); Thanks Varma Link to comment https://forums.phpfreaks.com/topic/154863-solved-session-cookie-in-internet-explorer/ Share on other sites More sharing options...
jackpf Posted April 20, 2009 Share Posted April 20, 2009 Well, that's how I set my cookies. Seems to work. However, I do precede my domain name with a full stop. I don't know whether it makes any difference, but that's the code I use. Link to comment https://forums.phpfreaks.com/topic/154863-solved-session-cookie-in-internet-explorer/#findComment-814468 Share on other sites More sharing options...
informvarma Posted April 20, 2009 Author Share Posted April 20, 2009 Nope, tried that too. dosent work. if I give a extended expiry time, like the snippet below, it works fine. setcookie('name', 'value', time()+3500, '/', 'www.domain.com'); Link to comment https://forums.phpfreaks.com/topic/154863-solved-session-cookie-in-internet-explorer/#findComment-814480 Share on other sites More sharing options...
informvarma Posted April 21, 2009 Author Share Posted April 21, 2009 damn, looks like IE session cookies has problems with domain name having `-`, removed that and all is fine. Link to comment https://forums.phpfreaks.com/topic/154863-solved-session-cookie-in-internet-explorer/#findComment-815205 Share on other sites More sharing options...
mandred Posted April 21, 2009 Share Posted April 21, 2009 You don't have to specify the path or the domain name. Also, time()+3500 is only about 1 hour. The cookie will not work once that hour comes, so make it a year if you're shooting for a 'forever' type cookie. Link to comment https://forums.phpfreaks.com/topic/154863-solved-session-cookie-in-internet-explorer/#findComment-815212 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.