Allan- Posted March 22, 2009 Share Posted March 22, 2009 In Firefox and Google Crome my code works correct, but in IE it doesnt. The problem is that before or after loading a page in IE, $_SESSION is unsetted. If i set $_SESSION['online'] = 1, then after reloading the page then print_r($_SESSION) outputs nothing. Quote Link to comment https://forums.phpfreaks.com/topic/150545-solved-session-doesnt-work-correct-in-ie8/ Share on other sites More sharing options...
MadTechie Posted March 22, 2009 Share Posted March 22, 2009 PHP is server side so not affected by client browser.. However, without seeing your code theirs not much we can say, does this code work (in its own file) ? <?php session_start(); if(isset($_SESSION['online'])) { $_SESSION['online']++; }else{ $_SESSION['online'] = 1; } echo $_SESSION['online']; ?> Quote Link to comment https://forums.phpfreaks.com/topic/150545-solved-session-doesnt-work-correct-in-ie8/#findComment-790744 Share on other sites More sharing options...
Allan- Posted March 22, 2009 Author Share Posted March 22, 2009 oops, Quote Link to comment https://forums.phpfreaks.com/topic/150545-solved-session-doesnt-work-correct-in-ie8/#findComment-790748 Share on other sites More sharing options...
MadTechie Posted March 22, 2009 Share Posted March 22, 2009 OKay if you want to post test code then please post some usefuil test code i don't see where your outputting anything Does the code i supplied work on your also you use IE8 beta (as that had bugs)? Quote Link to comment https://forums.phpfreaks.com/topic/150545-solved-session-doesnt-work-correct-in-ie8/#findComment-790750 Share on other sites More sharing options...
Allan- Posted March 22, 2009 Author Share Posted March 22, 2009 in ff it works but in ie it doesnt Quote Link to comment https://forums.phpfreaks.com/topic/150545-solved-session-doesnt-work-correct-in-ie8/#findComment-790752 Share on other sites More sharing options...
MadTechie Posted March 22, 2009 Share Posted March 22, 2009 Okay well if your not going to give me anything useful then what can i say! Works here Quote Link to comment https://forums.phpfreaks.com/topic/150545-solved-session-doesnt-work-correct-in-ie8/#findComment-790754 Share on other sites More sharing options...
Allan- Posted March 22, 2009 Author Share Posted March 22, 2009 I'll deal with this problem later then I just hate IE. Why cant it work fine as the other browsers. Quote Link to comment https://forums.phpfreaks.com/topic/150545-solved-session-doesnt-work-correct-in-ie8/#findComment-790755 Share on other sites More sharing options...
MadTechie Posted March 22, 2009 Share Posted March 22, 2009 Try on another computer, (or host your script an ask someone to test it) First try deleting all your IE8 cookies. Quote Link to comment https://forums.phpfreaks.com/topic/150545-solved-session-doesnt-work-correct-in-ie8/#findComment-790757 Share on other sites More sharing options...
stevedoolan Posted April 19, 2011 Share Posted April 19, 2011 I just had this issue show up, and (finally) managed to track down the problem / solution: IE8 rejects cookies when there is an underscore in the URL. http://genotrance.wordpress.com/2006/11/23/session-cookies-rejected-by-internet-explorer/ As ridiculous as it sounds, that's it. Quote Link to comment https://forums.phpfreaks.com/topic/150545-solved-session-doesnt-work-correct-in-ie8/#findComment-1203409 Share on other sites More sharing options...
Maq Posted April 19, 2011 Share Posted April 19, 2011 Although your post is helpful, please try and not to resurrect threads from over 2 years ago. Quote Link to comment https://forums.phpfreaks.com/topic/150545-solved-session-doesnt-work-correct-in-ie8/#findComment-1203461 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.