• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Generate a new JSessionID after login/role change

 
Neeraj Vij
Ranch Hand
Posts: 315
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I want to generate a new jessesion id after the user has logged into the system, rather than continuing with the jsessionid which was assigned when the user reached the homepage or was browsing thw website as anonymous user.

please provide inputs for generation a new jsession id.

req.getSession(true);// after login it still returns the jsession id generated before login.

Thanks in advance
Neeraj.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13058
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just invalidate the initial session, the system will generate a new ID. See the JavaDocs.

Bill
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic