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 Closing session of a web application  depending on the session of another application Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Closing session of a web application  depending on the session of another application" Watch "Closing session of a web application  depending on the session of another application" New topic
Author

Closing session of a web application depending on the session of another application

sumita mukherjee
Greenhorn

Joined: Aug 27, 2007
Posts: 22
Hi,

We have a struts web application which have a help link in that. Clicking on the help link opens another web app(also a struts app), which provides the help page. However, we have a requirement that whenever the main application(which has the help link in it) is closed(i.e. sesssion ends), the help page needs to be notified, so that its session ends too. I am not sure how to go about this. Will passing the JsesionId from the main page to the help app help in some way?

Any pointers regarding this would be a great help.

Thanks,
Sumita
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10210
    
166

Does not look specific to JBoss. I'll move this to an appropriate forum where you might get some expert advice.


[My Blog] [JavaRanch Journal]
sumita mukherjee
Greenhorn

Joined: Aug 27, 2007
Posts: 22
My apologies for this mistake. Thanks.
Steve Luke
Bartender

Joined: Jan 28, 2003
Posts: 4181
    
  21

You might be able to deploy a version of a Single Sign On scheme for your applications. I believe, sessions would be maintained independently in each application but when one session becomes invalidated, all sessions linked by the Single Sign On get invalidated.

Another option would be to deploy a session listener that allows you to track sessions yourself in your main application. The main application might make a request to a super-secret URL on the Help application when a session is invalidated telling the Help application which session just died. On the servlet living on the Help application you would then invalidate the Help application's session associated with the one that died on the main application. With this option passing some unique ID (why not the jsessionid?) to the Help application could be used to link the user in the main app with the user in the help app. Of course you would also have to maintain your own list of sessions in the Help application, mapped to the ID passed from the main app.


Steve
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Closing session of a web application depending on the session of another application