Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / October 2005

Tip: Looking for answers? Try searching our database.

Servlet Session Control

Thread view: 
Jackson - 22 Oct 2005 23:18 GMT
Say I only allow one session for each user. When one logined into the server
and he kills the browser, this user won't be able to login again untill the
session expires.

Is it possible to check at next login if there is any session inactivated
from browser has benn terminated.

J
Andreas Thiele - 24 Oct 2005 09:52 GMT
Jackson schrieb:

> Say I only allow one session for each user. When one logined into the server
> and he kills the browser, this user won't be able to login again untill the
[quoted text clipped - 4 lines]
>
> J

Sorry, I don't directly answer your question. AFAIK login out on non
SSL connections is not trivial. A nice article describing solutions can
be found at

http://www.javaworld.com/javaworld/jw-09-2004/jw-0927-logout.html

Andreas
John C. Bollinger - 28 Oct 2005 04:00 GMT
> Say I only allow one session for each user. When one logined into the server
> and he kills the browser, this user won't be able to login again untill the
> session expires.
>
> Is it possible to check at next login if there is any session inactivated
> from browser has benn terminated.

I'm not sure I understand you, but I think you're asking for a way that
an application server can determine whether the user agent with which
some user was participating in some particular HTTP session has been
shut down.  The answer to that question is "No" (whether or not it's the
question you meant). HTTP is a request/response protocol.  Between
requests, the server cannot obtain information about the status of
clients.  The only things it knows about them come from their requests.

If you really need to restrict clients to one session at a time but yet
be able to reconnect quickly when they drop a session without properly
logging out then you have a few options.  The most likely ones I see are:

(1) Make the session timeout very short.  Depending on the application,
this might not be feasible, but it might be worth the trouble to rig up
a Javascript that fed a heartbeat to the server to keep the session
alive.  If you were using AJAX techniques then that would fit right in,
but otherwise it might be painful.

(2) Cache a map from users to their live session in the servlet context,
and use it to give users the option of killing their previous session
when they attempt to log in again.  Chances are that this would be
pretty easy and reliable.

(3) Do nothing and just put up with it.

Signature

John Bollinger
jobollin@indiana.edu



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.