It's not a secret anymore!
The moose likes Servlets and the fly likes Creating new Session without invalidating current session Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Servlets
Reply Bookmark "Creating new Session without invalidating current session" Watch "Creating new Session without invalidating current session" New topic
Author

Creating new Session without invalidating current session

Duddiyanda Siraj
Greenhorn

Joined: Nov 11, 2004
Posts: 23
Hi guys,

Not sure whether this question has been asked - Is it possible to create a new session without invalidating the current session ? I couldn't find any info regarding this after spending lots of time in spec and search engine.

Appreciate if some one gives me a way to overcome this issue.

Thanks,

Siraj


Before every minute of action, there should be an hour of thought.<br />- Henry Ford
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Only one session can exist for a given user at a given time so, no.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Amarender Reddy
Ranch Hand

Joined: May 12, 2005
Posts: 54
Chaos !!

How could this be possible?

Imagine an application where the same user creates 2-3 active sessions and start making different changes in each session.

I dont think should ever be possible !

-Amar
Duddiyanda Siraj
Greenhorn

Joined: Nov 11, 2004
Posts: 23
"Siraj DH",
Please check your private messages regarding an important administrative matter.
-Ben

Changed

Chaos !!
How could this be possible?
Imagine an application where the same user creates 2-3 active sessions and start making different changes in each session.
I dont think should ever be possible !
-Amar



This is possible by opening multiple browser, each window is treated as a diffrent session. I am facing problem when it's multiple tabbed window in a single browser(with diffrent login), each tab is assigned with same session Id. This leads to context getting changed for each user.

As a fix I thought to keep the existing session open and create a new session for the second tab request.

Any thoughts or any other way to overcome this problem ?

Thanks,
Siraj
[ April 23, 2008: Message edited by: Sira jUddin ]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56175
    
  13

No, Having multiple session open in the same browser is not possible. If this, rather weird, scenario is a hard requirement, you'll need to maintain some sort of pseudo-sessions on your own. Personally, I think the requirement is madness.


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
Duddiyanda Siraj
Greenhorn

Joined: Nov 11, 2004
Posts: 23
Right, but you know client is the king . In IE6 they were opening multiple browser to update their customers details parallelly, there were no complaints. But as they started using IE7 opening single browser and multiple tab caused lots of chaos.

Thank you all for your inputs
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

You could do it using URL rewriting rather than cookies, but the trick as always is getting each tab to adopt a different session. You could also provide your own Session Manager (Tomcat allows you to do this) but I've never been remotely interested in going any further
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Creating new Session without invalidating current session
 
Similar Threads
Generating a new session id for a user
Creating new session
Problems invalidating HttpSession
Disabling forward button in browser
how to get a new session in mozilla firefox new window