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 passing the session from one application to another Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "passing the session from one application to another" Watch "passing the session from one application to another" New topic
Author

passing the session from one application to another

Robin John
Ranch Hand

Joined: Sep 10, 2008
Posts: 270

Hi,

i am dealing with 2 applications (2 ears) and i need the session to be the same throughout the 2 applications, to deal with session timeout.

i am doing a response.sendRedirect(actionUrl);
but its creating a new request totally and 'm loosing the session and other objects present in session.

i dont want to store the data in DB as well.

how to get to the other application with the same session intact.

any help would be grateful. thanks in advance.


Time is what we want the most, but what we use the worst. -- William Penn
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61103
    
  66

You cannot share a session between two applications.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

Hi Bear , please can you explain me in Detail
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41621
    
  55
Explain what? It's not possible.


Ping & DNS - my free Android networking tools app
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

Thanks Ulf... i did small application understand
Robin John
Ranch Hand

Joined: Sep 10, 2008
Posts: 270

then how to handle session timeout through one application to another.

i want to login in one application and go to another, the session inactive timer starts in login application but the session timer is started for another application also having different sessions, when i work on the second application the first application is in idle mode right? , so when i come back to first it has timed out. so how do i get the session shared so that i get the inactive intervals of both applications same. please help !
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

if you do not want 1st application 's session, then you invalidate it the time of going 2nd one... do vice versa

correct me if i am wrong
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41621
    
  55
correct me if i am wrong

You're wrong :-) That is exactly what doesn't work because one app's session can't be accessed from another app.

As I understand the problem, it's also the opposite of what is desired - not invalidating one session from the other, but making sure that they stay active. You might want to consider a shared data store for the session data, maybe a database.
[ September 12, 2008: Message edited by: Ulf Dittmer ]
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

Thanks Ulf
 
wood burning stoves
 
subject: passing the session from one application to another