Click to See Complete Forum and Search --> : session variables/cookies/reload


darth_matthias
July 31st, 2000, 10:21 AM
I have a message forum programmed in ASP, where the main page displays your identity if you have logged in or a 'log in' button if not - trouble is, if someone logs in it sets the cookie and session variables ok then goes back to the main page, but instead of reloading the main page it displays the cached version - ie still has 'log in' button rather than the identity. the user needs to hit the 'refresh' button to get it to reload and set this part of the page right. Has anyone got any idea how to either get it to reload the page rather than load the cached version, or do *one* automatic refresh each time the main page is opened?

Johnny101
July 31st, 2000, 10:44 AM
that's one of my biggest problems with IE and especially IE 5. what i've done to get around it is to append a querystring to the main page. it wont affect processing at all, but IE thinks it's a different page so it doesn't look in its cache first.

'when youre done verifying the user
response.redirect "default.asp?x=1"




you could also generate some random number in hopes that IE wont cache this URL as well. You could also set one of the META tags to not cache. Unfortunately, i dont remember what the syntax is, but i remember reading something about this and setting some META tag that tells the browser not to cache this page - forcing a reload from the server each time.

good luck.

hope this helps,

John

John Pirkey
MCSD
http://www.ShallowWaterSystems.com
http://www.stlvbug.org

darth_matthias
July 31st, 2000, 11:05 AM
or, alternatively (he says, answering his own question and wishing he'd tried looking in the PWS documentation earlier)

Response.Expires = 0

will prevent the page being cached in the first place. Seems to work so far......

--matt
Mage WoDMod team - http://wodmod.themasquerade.org
http://www.PrimatesInSpace.co.uk moderator & content author