views:

64

answers:

1

I remove an item from the session using Session.Remove(), then redirect to another page. If I click back, then reload, the item is suddenly back in the session. Shouldn't Session.Remove() take it out of the session for good?

+2  A: 

The Remove method does remove the item, and it can not reappear by itself.

Either you are viewing a cached version of the page, or you have code somewhere that adds the item to the Session object again.

You can display the current time somewhere on the page to determine if you see a cached page or not.

Pressing ctrl when reloading the page will tell the browser to not use cached data.

Guffa
Yeah, there was a renegade line of code re-adding the item to the session after I removed it. Took a lot of stepping to find it. Not one of my finer moments, but thank you.
NYSystemsAnalyst