• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

create a new session when valid session is already existing?

 
Salil Vverma
Ranch Hand
Posts: 257
Hibernate Oracle Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can we create a new session when one valid session is already existing for a specific user? If yes, then how ?
 
Balu Sadhasivam
Ranch Hand
Posts: 874
Android Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Verma
Yes , you can.
invalidate the session that's existing.
Create a new session using request.getSession(true) . session.isNew() should return true.
 
Lorenz Baylon
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi, not to hijack the thread, just a follow up question. Does creating a new session while another session is alive automatically invalidates the old/previous session? Is it possible to have two live sessions in a webapp? Im planning to try this later but until then maybe you can give some insights. Thanks.
 
Balu Sadhasivam
Ranch Hand
Posts: 874
Android Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@lhorenz
Firstly , you cannot create a new session , when a session exists.

request.getSession() , would return existing session if exists , so its not possible . may be you can try to hack others session as you did with thread
 
Lorenz Baylon
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Balu, good point for both session and thread-jacking
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic