Page 1 of 1

about axpiry of sessions

Posted: Wed Aug 25, 2004 1:04 am
by bugthefixer
how do i know whether session has expires so that i can do something else rather then showing a message displaying that session has been expired.

actually i want to refresh page if the session has expired. anybody can tell me how can i do that.

Posted: Wed Aug 25, 2004 1:04 am
by feyd
the session normally won't expire until the browser is closed..

Posted: Wed Aug 25, 2004 1:11 am
by bugthefixer
but i get this information.

Warning: Page has Expired The page you requested was created using information you submitted in a form. This page is no longer available. As a security precaution, Internet Explorer does not automatically resubmit your information for you.

To resubmit your information and view this Web page, click the Refresh button.


and it happens due to sessions

Posted: Wed Aug 25, 2004 1:13 am
by d3ad1ysp0rk
No it doesn't. It happens due to you hitting the back button on your browser and trying to refresh it when $_POST data has already been sent.

Posted: Wed Aug 25, 2004 1:13 am
by feyd
that's due to the page content being derived from a form post.

Posted: Wed Aug 25, 2004 1:18 am
by bugthefixer
so is there anyway to find out that page is not displayed rather its expired
i want to do it so that page should refresh automatically when it is expired.

Posted: Wed Aug 25, 2004 1:27 am
by feyd
you set the expiration.. so uh.. you could add a meta-refresh..

Posted: Wed Aug 25, 2004 1:33 am
by bugthefixer
can u help me in code

Code: Select all

header("refresh: ");
wat shud i write after 'refresh:' and where shud i place it in the page.
and dont u think it will always refresh the page and page will never be displayed.

Posted: Wed Aug 25, 2004 1:39 am
by feyd
you need an in-page refresh.. not a header refresh...

Code: Select all

<head>
<meta http-equiv="refresh" content="180" />
</head>

Posted: Wed Aug 25, 2004 1:42 am
by bugthefixer
but i think it will refresh after every 180 seconds but i want to refresh it only once.

Posted: Wed Aug 25, 2004 1:44 am
by feyd
then you'll have to script it to only run once.. have fun..

Posted: Wed Aug 25, 2004 10:15 am
by hedge
bugthefixer wrote:but i get this information.

Warning: Page has Expired The page you requested was created using information you submitted in a form. This page is no longer available. As a security precaution, Internet Explorer does not automatically resubmit your information for you.

To resubmit your information and view this Web page, click the Refresh button.


and it happens due to sessions
The only way I've found to elmininate this problem is to have the script that receives the POST data not respond directly to the browser.. I have the script do it's work and then at the bottom it sends a header("location...") to the browser.

Kinda hard to explain.

1. enter page via GET: build page
2. enter page via POST: make db changes, then do a header back to php_self

this seems to break the POST/response and get rid of the browser refresh issue.