RE: [PHP] session and back button
| From: | Boget, Chris | Date: | Tue, 22 May 2001 16:40:23 +0000 |
| Subject: | RE: [PHP] session and back button | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-53880@lists.php.net to get a copy of this message | ||
> I'm using sessions and if the user hits the back button an
> expiration page appears! how can i disable the back button ?
> i tried window.history.forward(1) but it fails !
Even more interesting is that when a user presses the back
button all the way back to the page that initially started the
session, a new session is started. As such, all information
previously stored will be lost.
What I did to fix my problem (and I think it'll fix yours) is
that I start the session on a page the user cannot go "back"
to. To do that, the only code in the file is:
<?
session_start();
header( "location: /home_page.php" );
exit();
?>
Chris