Page seems to be remembering HttpSessionState

N

Nathan Sokalski

I have a page that determines some of what to display based on
HttpSessionState. When I go to it the first time, it displays everything the
way I would expect. Then I go to another page on my site (by clicking links,
so I am still using the same browser window), which calls Session.Abandon()
to start a new Session. Then when I click a link to go to the page that uses
the HttpSessionState, it still uses the values that were in it when I left.
If I then click the browser's Refresh button, it uses the values from the
new Session. What do I need to do to make the user not need to click the
Refresh button? Thanks.
 
G

Gaurav Vaish \(MasterGaurav\)

It's the browser issue.. ensure that the caching is turned off.
 
J

Joerg Jooss

Thus wrote Nathan,
I have a page that determines some of what to display based on
HttpSessionState. When I go to it the first time, it displays
everything the way I would expect. Then I go to another page on my
site (by clicking links, so I am still using the same browser window),
which calls Session.Abandon() to start a new Session. Then when I
click a link to go to the page that uses the HttpSessionState, it
still uses the values that were in it when I left. If I then click the
browser's Refresh button, it uses the values from the new Session.
What do I need to do to make the user not need to click the Refresh
button? Thanks.

Mark the page uncacheable. Either set the page direction <%@ OutputCache
Location="None" %> or call Response.Cache.SetCacheability(HttpCacheability.NoCache).

Cheers,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,135
Latest member
VeronaShap
Top