File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Logging out of multiple web application from single servlet

 
Kripal Singh
Ranch Hand
Posts: 254
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry for posting this again i thought it's more suitable here

I have deployed a single EAR file with multiple web application (WAR files)

I am trying to invalidate the session for all of the web application at any given moment (logout for multiple web app). What is the best way of doing it in servlets? Or is it possible to do it in application.xml
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 33694
316
Eclipse IDE Java VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Kripal,
As far as I know, a session is only for a web app. I know you can't access sessions in multiple ears and assume that is true for wars.

We use a third party product (trusted application inteceptor) for this. Or if you have a predefined number of apps, you could have your app call a logout action on all the other apps.
 
Ajith Anand
Ranch Hand
Posts: 40
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Kripal,

I think it very much depends on the applicaton server as well as the session-management mechanism of the server.

In a cookie-based scenario so long as you are in compliance with the cookie read/write rules ( you are not reading a cookie of yahoo.com from a domain yourapp.com etc....please refer for more details..
cookie reference )

I think you can achieve this by way of unsetting all the cookies , especially the "SESSIONID" / "AUTHENTICATION" cookies from one of your servlets, make sure you are doing this for all the paths you would refer to in your WARs. For eg if you have app1.war app2.war with context paths app1 and app2 in your EAR. you would need to unset the cookies for paths : app1 and app2.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic