Hai

I made a login system in php and every thing working fine in IE and mozilla. But in Safari and in Opera when I click sign out then it works fine and after that if I press back button in browser then it comes to the previous page (myaccount page ) and shows the contents in that page even if I logout. I used the following code for session destroy

session_start();
$_SESSION = array();
session_destroy();
unset($_SESSION['mysiteUser']);
unset($_SESSION['mysiteUser']);

I am in a critical stage please help me with a right advise.

Thanks in advance
Rajeesh

Recommended Answers

All 3 Replies

Did you include logic on your myaccount page (and all the other pages on your site) to redirect to the login page if no active session is detected? If not, I think that would be a way to solve your problem.

Hai

Everything is done and working perfectly other than in safari and opera. I think this is because of page caching. Bcoz if I press back button in browser then it will return to "myAccount" page and it will redirected to logout page when I press "refresh" . Is there is any way to avoid that please help

Thanks
Rajeesh

Did you include logic on your myaccount page (and all the other pages on your site) to redirect to the login page if no active session is detected? If not, I think that would be a way to solve your problem.

It is in the users cache and although they can press back and view the pages they can't click any links or make any changes. Then this comes to the question disabling the back button which I believe isn't possible but you never know what's possible.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.