Page seems to be remembering HttpSessionState

  • Thread starter Thread starter Nathan Sokalski
  • Start date Start date
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.
 
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,
 
Back
Top