Venu-
  We have been encountering the same problem -- what to do when a user
launches a second browser window and the session object being accessed is
the same.  We use an "instance ID" (a random number String) as the name of
the HashMap object we store in the session, which in turn has objects within
it.  For example: session.setAttribute(instanceID, sessionDataObject).  The
instance ID is passed in the request object from page to page so you can
always access a unique session object.

  The problem still is how to know when to create a new instance ID.  You
can offer the user a button or link to launch a new browser window and
create a new instance then.  But when the user right-clicks or uses the
browser menu to open a new window, the same request is carried over.  If
your screens are in a frame, the frame pages can carry the instance ID and
the main frameset (which would be what is launched in a new window) could be
a servlet which always creates a new instance.

  I would be interested to hear how other people are handling this problem
of multiple windows/single session object.  I haven't seen any way to get a
JSP to recognize that a new window has been opened and should have a
distinct session.  I hope some of these ideas help.
-katherine


-----Original Message-----
From: Venu Gopal [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 08, 2001 4:40 PM
To: [EMAIL PROTECTED]
Subject: Re: How does the session is maintained incase of multiple
loginfrom the same mac?


But then how do you get the two distinct users in the
two opened windows? They are sharing the same session
object. And even if you generate a random number, how
can you track in that jsp file and find out? Is there
any way to tell jsp to use different session
ids/objects for different browser windows which are
getting open??

Cheers,
Venu

--- Kevin Duffey <[EMAIL PROTECTED]> wrote:
> The only way I can think of is by having every link
> of every page returned
> apply some sort of random number. Something like:
>
> <a href="/path/page.jsp?number=<%=
> bean.getRandomNumber() %>">click</a> in a
> jsp page.
>
> That way, every link on every request has a
> different URL each time its
> returned. But, I don't see how that will resolve
> your issue.
>
>
> > -----Original Message-----
> > From: A mailing list about Java Server Pages
> specification and reference
> > [mailto:[EMAIL PROTECTED]]On Behalf Of
> Rathna
> > Sent: Thursday, January 04, 2001 11:08 PM
> > To: [EMAIL PROTECTED]
> > Subject: Re: How does the session is maintained
> incase of multiple
> > loginfrom the same mac?
> >
> >
> > hi,
> >
> > i am using cookies for the session tracking
> (request.getSession( )),
> > when i log into the system i will put the userInfo
> object into the
> > session object and each page i will check for
> existence of the userInfo
> > object in session , if exist allow the user to
> continue the page
> > ,stop it otherwise.
> >
> > if two browser instance in a mac. uses the same
> session id , is
> > there any other  way of
> > identifying or differentiating the session (like
> using ip address
> > of the client) ? so that the
> > session information is not over written ...
> >
> >
> > thanx in advance ...
> >
> > with rgds,
> >            rathna.
> >
> >
> >
> >
> > Bhushan Bhangale wrote:
> >
> > > Hi
> > >
> > > The two browsers on the same machine will always
> have two
> > different session. You said they are using same
> session object
> > but they will have different session id.
> > >
> > > Do tell me whether you are maintaining session
> using cookie or
> > via url rewriting or the application server is
> taking care of it.
> > >
> > > If you are using cookie then probably it is a
> problem of you
> > are taking care of this kind of situation. For
> rest methods of
> > maintaining session there won't be any problem.
> > >
> > > Anyway do write me back.
> > >
> > > Cheers!!!!!!!!
> > >
> > > ----------Original Message --------------
> > > hi all,
> > >
> > > How does the session is being maintained when
> there is more than one
> > > browser launched in the mac.?
> > >
> > > Here is the detailed description of the problem,
> > >
> > > i have a session which is associated with the
> user.In the session i
> > > have information about user privileges which
> will be used in the
> > > application.
> > > when i have two browser logged into my
> application with different user
> > > login's,
> > > both is sharing the same session object and
> hence the privileges of
> > > second
> > > browser user will be used or accessed by the
> first browser.
> > > how to over come this problem?
> > >
> > > --
> > > Cheers,
> > >     rathna
> > >
> > > ø¤°`°¤ø,¸¸¸,ø¤°`°¤ø,¸¸»«¸,ø¤°`°¤ø,¸¸,ø¤°`°¤ø
> > >

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
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