Since all request are coming from the same browser instance (even if different 
windows), there is only one session as far as the servlet knows.  There's no way 
around that.  Of course, using two different browsers would keep the sessions distinct 
(i.e., user opens IE, then opens Netscape).

The thing I would suggest is to store a flag or something in the session immediately 
after a user has logged in.  Then send an error back on any request that tries to log 
in while this flag is true.  That should prevent multiple concurrent users.

Dave F.

Venkat Kethababoyina wrote:

> I have a simple registration servlet that uses session
> object to store the registration objects until the
> operation is completed. I am running in to problems
> when a user does the following:
>
> a) opens two browser windows from the *same* machine
> and tries to register two users simultaneously. Since
> our registration involves multiple pages, the user can
> finsh the first page of one account and then start the
> second page of the second and so on.. Essentially, the
> operations are interspersed.
>
> b) Now,if I use the session object to store
> registration info I am getting one user's data in
> place of another's. It looks like I am getting the
> same session object when I'm asking for
> request.getSession(). I would like to know if we get
> different sessions or same session in this scenario.
> If it is same session, is there a way to keep track of
> different user's data in the same session?
>
> Thanks for your suggestions.
>
> Venkat
>
> __________________________________________________
> Do You Yahoo!?
> Send online invitations with Yahoo! Invites.
> http://invites.yahoo.com
>
> ===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to