cdugga
cdugga

Reputation: 3859

Browser back button - does it delete session data?

Does hitting the back button in a web browser cause the session data set in the preceding call to be deleted?

Upvotes: 2

Views: 3339

Answers (3)

JacquesB
JacquesB

Reputation: 42679

Server-side session data is handled by the web framework, so behavior may differ. However almost all frameworks map session data to cookies, which are not lost when using the back button.

Some frameworks may however encode session ID's in URL's rather than in cookies (often as a fall-back if the browsers doesn't support cookies), and in that case the browsers may lose the session id, if it "backs" out.

Upvotes: 1

Corey Trager
Corey Trager

Reputation: 23131

No. It just causes the browser to either send again what it just sent to the server, or it will cause the browser to fetch the page from its cache, without interacting with the server at all.

Upvotes: 0

Tamas Czinege
Tamas Czinege

Reputation: 121384

No, it does not.

Well, if the user arrived to the previous page by POST (as opposed to GET) and reposts the page, the server is going to process the request again. It won't delete the data in the session though. It is possible to achieve this behaviour with some code, but that's not how it works by default.

Upvotes: 3

Related Questions