Persistent cookies are saved on client's drive, are shared betwen
browser processes - you should try them.
Create a persistent (non-session) cookie called "BowserUniqueId",
with an unique value, if it isnt in current request.
Use a static hashtable to store BrowserUniqueId values as keys, and
HttpSessions as values.
Each time a request came, retrieve the "BrowserUniqueId" cookie from
browser, then retrieve the associated session from the static container,
and if that is a different session than the one returned by the servlet
engine you know one user has opened a new browser process to access
the same servlet, and runs two different sessions.
If there is now session storred under "BrowserUniqueId" key just store the
current one, you know that the user just opened its first browser, and
the "BrowserUniqueId" cookie was remembered from a previous run of
its browser..
However, user can trick you - he can use different browser installations,
or IE and Netscape... You can't force him not to.
Cezar.
On Tue, 31 Aug 1999, Neeraj Arora wrote:
> Hi to all,
>
> I am facing a problem-
>
> I want my user to have only one browser window to see my site, i.e.
> if he opens another window from different login/password then the previous session
> should be invalidated.Is there any method to do that?
>
> It would be very helpful of you if suggest how to practically implement this(i mean
>example code'll
> be a great help).
>
> Thanks in advance
> Neeraj
>
>
> Get your FREE Email at http://mailcity.lycos.com
> Get your PERSONALIZED START PAGE at http://my.lycos.com
>
> ___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html