Click to See Complete Forum and Search --> : session cache / timeout question
tripwater
10-01-2003, 01:01 PM
I posted this in the general forum, but it maybe more appropriate here.
I have a site that I built using php, running apache server.
I have noticed that when you hit back in the browser, the page has timed out in IE and requires a refresh, in Mozilla it popups a box to let you know that it needs to resend post data.
I understand this, but the remedy is what has me troubled. I added :
session_cache_limiter('private_no_expire');
at the top of a few of the pages and now everything seems fine. So I decided to set this in Apache so I do not have to add this at the top of all of my pages and it does what the function, did only now I have problems with session vars not being set properly or when I set the page to refresh after setting a new session var it does not work.
I see alot of sites that allow you to enter post info and hit the back button and my site is annoying with this. Any ideas?
Thank you.
fyrestrtr
10-06-2003, 04:07 AM
Well it is working as expected. You are messing with the PHP session timeouts, not the HTML timeouts (which is why you get those POST expired errors).
Searching for "avoiding POST timeout" at your favorite search engine will help.
tripwater
10-06-2003, 10:38 AM
Thanks for the reply.
Well I did a search and really did not find anything helpful. Everyone seems to be trying to set a timeout for credit card info or stop it.
IE = Warning page has expired. They do not resend info.
I do not understand Mozilla's message first of all : POSTDATA has expired from the cache.
The data they posted hasn't expired or else they wouldn't be able to resend it.
And why does this happen within a millisecond of hitting the page then trying to hit back button?
I admit I am confused.
Is there something I need to put in the header I am unaware of or some setting in Apache? I just do not want users to have to hit OK and refresh 20 times when they visit my site if they need to make a change.
Thanks for any help.
fyrestrtr
10-06-2003, 11:58 AM
For IE the message means that the form they used is expired because they have already sent information using it. So if there were to go back and reload it, their information would be sent again.
Mozilla is saying that the information for the post operation is no longer in the cache...that is, the local cache of the browser.
The reason it happens "milliseconds" is because once the user hits submit, the information (along with the POST data) is sent, and if they were to reload it, it would be resent again.
For your last question, you can use meta tags (pragma=no-cache, I think) to ask the browser to not cache the page. However, this is dependent on the user, and the user can chose wether to cache or not the page.
tripwater
10-06-2003, 12:04 PM
Thank you.
I just know that almost all sites I visit handle the back button and I never have to deal with this inconveinence. So are all of those sites setting this meta tag you are mentioning? If so, does this not mean that the browser does not cache ?
How does Amazon.com and sites like that hold all of my user info when I hit the back button without it caching? I do not get that message on sites like that. I would offer maybe session vars, but that would mean they are setting every POST element = to a session var so you could view it again and I don't see how that is possible with heavy traffic like Amazon gets. I am really ignorant to this aspect of a website so I apologize. Please clarify if anyone knows the answer.
Thank you again
tripwater
10-10-2003, 04:02 PM
?