thedevilinu Posted August 24, 2013 Share Posted August 24, 2013 This problem is for real PHP freaks. I do not post in forums unless I really can't find a solution. I have been bugged by this for days now. Here it is. I have a page signup.php among other pages on the website. Once you logout from logout.php all session is destroyed and all cookies are deleted. you can visit the website as a visitor after logging out. I visited all pages to make sure I was really logged out. Everything is normal up till here. However, when I click on signup again which call signup.php, the old session becomes suddenly alive and you are logged in again as if you had never logged out. I have never faced this problem before and I have made many websites using PHP. I have tested and found that session is already there when the page loads and values are not formed by any variable or function manipulation. I am using hostgator shared hosting. Please guyz help me out. I am not sure what I am doing wrong here. Quote Link to comment https://forums.phpfreaks.com/topic/281516-php-session-problem-only-on-one-page-throughout-the-website/ Share on other sites More sharing options...
mac_gyver Posted August 24, 2013 Share Posted August 24, 2013 we cannot really help you without the code that reproduces the problem, to pin down the many different possibilities to just the one that is actually causing the problem. by seeing what your code is doing (redirecting, including, setting/testing variables/cookies, trying - successful or not - to remove cookies), lets us know which direction to look. best guess is you actually have two different sessions, due to different host-names (www. vs no-www.) in the URL's and the session cookie domain setting is only matching the host-name where the session was created and you are visiting the signup page using a different host-name from where the session was destroyed at and you are seeing the second session data. second best guess, you are passing the session id in the url (intentionally/unintentionally) and resuming the session (are you also destroying the session data file?) Quote Link to comment https://forums.phpfreaks.com/topic/281516-php-session-problem-only-on-one-page-throughout-the-website/#findComment-1446540 Share on other sites More sharing options...
floridaflatlander Posted August 24, 2013 Share Posted August 24, 2013 (edited) so you used session_destroy() and you destroyed your session cookie name (time()-x)? Can you echo the session variables after you logout? Can you post your logout code? Are you using ie? Not that I'm talking bad about ie but believe it or not I had something like this happen a few months ago, I looked at it for hours, I restarted my machine and I guess ie reloaded correctly and it work from then on. Edited August 24, 2013 by floridaflatlander Quote Link to comment https://forums.phpfreaks.com/topic/281516-php-session-problem-only-on-one-page-throughout-the-website/#findComment-1446541 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.