faqts : Computers : Programming : Languages : PHP : Common Problems : Sessions and State

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

3 of 7 people (43%) answered Yes
Recently 3 of 7 people (43%) answered Yes

Entry

While using sessions, if the browser's back button is clicked the page expires. How to avoid this?

Jan 21st, 2008 17:03
Tim Stumbaugh, Shunmuga prasath,


Short answer: Don't use POST. This is not related to sessions

When you use the POST method (i.e. a form), the browser doesn't re-post
the data every time the page is refreshed to prevent things like doing
an online purchase twice.

I can't tell from your question, but it may be that the page is expiring
from the cache. If this is the case, use the header() command to set the
cache.