Question

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?

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top