[prev in list] [next in list] [prev in thread] [next in thread] 

List:       tomcat-user
Subject:    Re: problem with sessions
From:       "abhishek reddy" <abhishek.c1984 () gmail ! com>
Date:       2008-06-30 7:12:01
Message-ID: d9547ce70806300000m22a272bbx9c3b8cbd9119b343 () mail ! gmail ! com
[Download RAW message or body]

thanks for the quick reply...
i didnot get u ?
can u please elaborate it?



On 6/27/08, Leon Rosenberg <rosenberg.leon@googlemail.com> wrote:
> Hello Abhishek,
>
> if you open a new window in a browser (except internet explorer with
> setting start new window in new process = on) your new window belongs
> to the same process as the old window, sharing all the states,
> including session cookies. So both windows are tied to the same
> session.
> If you want to have multiple sessions:
> - use different browsers (firefox 3, firefx 2, netscape 9 (which is
> firefox), flock, mozilla, camino, ie, safari)
> - if you use internet explorer -> set the above setting to true
> - define multiple virtual hosts in /etc/hosts 127.0.0.1 localhost
> myhost1 myhost2 myhost3, and use them in different windows.
>
> regards
> Leon
>
> P.S. on a side note, doing all that in a jsp is rather outdated, try
> to use a decent web framework and avoid scriptlets.
>
>
> On Fri, Jun 27, 2008 at 8:05 AM, abhishek reddy
> <abhishek.c1984@gmail.com> wrote:
> > hi every one,
> >
> > i have a jsp page, once the user logged in iam creating a session in
> > the jsp page.When the user logged out iam invalidating the session.
> >
> > when two users logged in, and if one user logged out, the other user
> > session is also getting invalidated.I dont want this to happen i.e.
> > evethough the first user logged out second can continue his work.
> >
> > Can any one tell me how to solve this problem?
> >
> > here is the code..
> >
> > once the user logged in, he will move to session.jsp page
> >
> > session.jsp page
> >
> >    code:
> >
> >
> >    <div align='left'><a href="logout.jsp">Logout</a>    <a
> > href="compose.jsp">Compose</a></div>
> >    <BR>
> >    <%
> >    out.println("Is session new ?"+session.isNew()+"<BR>");
> >    out.println("session id="+session.getId());
> >    session.setAttribute("check","check");
> >    %>
> >
> >
> >
> > once the user click the logout link, he will be logged out and session
> > will be invalidated
> >
> > logout.jsp page
> >
> >    code:
> >
> >
> >    <%
> >    session.invalidate();
> >    out.println("Session Invalidated..");
> >    %>
> >
> >
> >
> > here is the compose page, here iam checking the varaibale set in
> > session.if it is null iam forwarding back to login page.
> >
> >    code:
> >
> >     <%
> >    String check=(String)session.getAttribute("check");
> >    if (check==null)
> >    {
> >        %>
> >        <jsp:forward page="slogin.jsp">
> >        <jsp:param name="memid" value="" />
> >        </jsp:forward>
> >        <%
> >    }
> >    else
> >    {
> >        out.println("Session exists proceed to do the work");
> >    }
> >    %>
> >
> >
> > the problem comes when i open a new window from an existing window.
> >
> > i.e. for example , i have opened a new window and typed the login page url.
> > now i opened another window from an exisitng window using control+N option.
> > like wise i opened three windows.
> >
> > So, when i open the windows in this fashion, session created in the
> > main window will be same in all the windows that opened thru control+N
> > option.
> >
> > So, when the user logged out from any one of the windows, session will
> > be invalidated in all the windows..
> >
> > tell me how to sort this problem.
> > --
> > Abhishek
> >
> > ---------------------------------------------------------------------
> > To start a new topic, e-mail: users@tomcat.apache.org
> > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> > For additional commands, e-mail: users-help@tomcat.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>


-- 
Abhishek

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic