Click to See Complete Forum and Search --> : Back buton internet explorer


rbollen
05-15-2003, 03:59 AM
Hyia,

I have a problem. I'm creating a website with account. When a user is logged in, he can edit his account.

After he loggs out, i redirect him to an other page. But when i click on the BACK button of my browser, i can still see the account settings.

Is there a way to prevent the browser from showing those account settings when the user is logged out?

Thanks in advance

Gollum
05-15-2003, 04:23 AM
One simple way is to set the HTTP headers for the page to expire immediately so that even if the user hits the back button, the browser will still go to the server to get it where you can output a new page saying "Sorry, you've logged out!"

rbollen
05-15-2003, 04:26 AM
that's what i mean, but how do i do that?

Gollum
05-15-2003, 04:40 AM
This isn't really relevant to a Javascript forum, but here it is anyway...

The HTTP headers you're after are...

cache-control:no-cache
pragma:no-cache
expires:0

have a look in your server set-up. In some systems, you can set these things in property sheets.

Alternatively you can set it explicitly in code for each response like in the following ASP...

Response.CacheControl = "Private"
Response.Expires = -1