[Opensource] CurrentLogin problems

Thompson, Kris kris.thompson at seurat.com
Thu Jun 19 08:43:22 PDT 2003


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/
> 



More information about the Opensource mailing list