[Opensource] CurrentLogin problems

Tino Dai tdai at optonline.net
Thu Jun 19 16:51:34 PDT 2003


Hi Everybody,

   So, Mike told me what I did wrong. The coding is correct, but you
can't fire off two instances in the same browser (one tab in mozilla had
one and the other tab has another), because the cookie overwrite one
another. If you fire up two browsers on two separate accounts or two
separate machines, the problem goes away. Thanks for all the help.

-Tino

PS: Kris, thanks for checking in on me!
On Thu, 2003-06-19 at 11:43, Thompson, Kris wrote:
> What is the problem?  Do you get exceptions, does it destroy the other user's session? 
> 
> What controller is this Snippet from? 
> 
> Kris Thompson
> 
> > -----Original Message-----
> > From: Tino Dai [mailto:tdai at optonline.net]
> > Sent: Thursday, June 19, 2003 9:01 AM
> > To: opensource at jcorporate.com
> > Subject: [Opensource] CurrentLogin problems
> > 
> > 
> > Hi Everyone,
> > 
> >     I got my program working with CurrentLogin, but it 
> > doesn't work for
> > multi-users such as user mike and oberoc logged in at the same time.
> > Could tell me the correct way of doing this. I have snippets 
> > of my code
> > below: The explanation is I used the session object to 
> > physically remove
> > and add back in the Currentlogin. It seems that there is only one
> > instance  of the session. I don't have a clue on how to fix this.
> > 
> > ServletControllerRequest sr = (ServletControllerRequest) request;
> > HttpServletRequest hreq = (HttpServletRequest) sr.getServletRequest();
> >         
> > myUser.setField("username",request.getParameter("UserName"));
> >  if ( myUser.find() ) {
> >   String tempPass=myUser.getField("password");
> >   if (tempPass.equals(request.getParameter("PassWord"))) {
> >     CurrentLogin myLogin = new 
> > CurrentLogin(GenericSession.getId(hreq),
> >                            request.getParameter("UserName"),
> >                            hreq.getRemoteAddr(),request.getDBName(),
> >                            System.currentTimeMillis(),
> >                            myUser.getFieldInt("uid"));
> >     PersistentSession session = request.getSession();
> >     session.removePersistentAttribute("CurrentLogin");
> >     session.setPersistentAttribute("CurrentLogin",myLogin);
> > 
> > Thanks in advance,
> > Tino
> > 
> > 
> > _______________________________________________
> > Opensource mailing list
> > Opensource at jcorporate.com
> > http://mail.jcorporate.com/mailman/listinfo/opensource
> > Archives: http://mail.jcorporate.com/pipermail/opensource/
> > 
> _______________________________________________
> Opensource mailing list
> Opensource at jcorporate.com
> http://mail.jcorporate.com/mailman/listinfo/opensource
> Archives: http://mail.jcorporate.com/pipermail/opensource/





More information about the Opensource mailing list