nnc
nnc

Reputation: 840

Get Information About Inavlidated HttpServletRequest Session

I want to differentiate between:

  1. New session created by time-out of previous session.
  2. A new session created by opening the page in new session of a browser.

Is there a way I can identify these two in a new HTTPServeletRequest?

Upvotes: 1

Views: 44

Answers (1)

Jigar Joshi
Jigar Joshi

Reputation: 240966

You can implement SessionListener and manage to get new session and old session mapping,

However to decide where to redirect upon new login (as you commented)

you should store referrer header in session

For example:

  • after session has been destroyed

  • user gets redirected to login page

  • get the referrer header put it in session and on successful login read it from session and redirect there

Upvotes: 1

Related Questions