Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to find session btn two web appl

 
sammeta Phanikumar
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ranchers,

Would you please help me how to identify session between two web applicaitons. When a user clicks link to second application from first. I want to close his sesion on first appl and want to maintian count of live sessions on first application.

I have tried with HttpSession and HttpActivationSession but no use.

Please help me.
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
session can not be shared between two different web application
 
sammeta Phanikumar
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks For your reply,

Session can not be shared. ok..but want first appl to be notified when a session leaves his appl.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64827
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please use real words when posting to the forums. Abbreviations such as "btn" in place of "between" only serve to make your posts more difficult to read and less likely to generate useful responses.

Please read this for more information.

thanks,
bear
JavaRanch sheriff
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34378
346
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sammeta,
You can know when they logout or a session timeouts. If they are going to another app you control, you can include a hidden iframe with a logout link back to the first application.

However, you wouldn't always know when they left as they could go to a different website or close the browser. The only way to know for sure is with constant pinging which is a drain on resources.
 
Steve Luke
Bartender
Posts: 4181
21
IntelliJ IDE Java Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi sammeta, I wanted to respond to your P.M. about this topic.

The only thing that I really can say is to agree with Jeanne. If you are following a link to an application you control then you can provide an IFrame that goes back to the first app and logs the user out. A similar alternative would be to make any links to the second application a link to a logout page in application 1 that then redirects to a page in application 2. This way you can keep the session control in a single app (you could pass the URL to application2's page as a parameter to the logout page).

As Jeanne said, you still can't tell if the user goes to some other website, or closes their browser. In addition to those limitations, the one I proposed also wouldn't work if the user makes bookmarks for the application2 page, or manually enters the application2 page's URL into the address bar.

<p.s. sammeta, I am happy to help, and don't mind the P.M.s asking me to take a look at a particular thread. But as an FYI I will always respond in the thread itself, since it will help the JavaRanch community as a whole>
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic