File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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


Win a copy of Soft Skills this week in the Jobs Discussion forum!
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: 12835
    
    5
Just invalidate the initial session, the system will generate a new ID. See the JavaDocs.

Bill
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Generate a new JSessionID after login/role change