wood burning stoves*
The moose likes Servlets and the fly likes Generate a new JSessionID after login/role change Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Generate a new JSessionID after login/role change" Watch "Generate a new JSessionID after login/role change" New topic
Author

Generate a new JSessionID after login/role change

Neeraj Vij
Ranch Hand

Joined: Nov 25, 2003
Posts: 315
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

Joined: Mar 22, 2000
Posts: 12761
    
    5
Just invalidate the initial session, the system will generate a new ID. See the JavaDocs.

Bill
 
jQuery in Action, 2nd edition
 
subject: Generate a new JSessionID after login/role change
 
Similar Threads
Session Validation Filter
cookies,encodeUrl,jsessionid confusion
webapp authorization
How to set Session tracking cookie other than in weblogic.xml
ways for swing client to connect to weblogic server behind firewall