You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Angelo Chen <an...@yahoo.com.hk> on 2007/08/30 16:00:35 UTC

T5:remember the loginned user

Hi,

In my program I'd verify the user and create an ASO until he log out or the
ASO expires. Now I'd like to add an option: 'remember me' like the one in
yahoo, if checked, program will automatically login the user next time, how
to achieve this? thanks.

A.C.
-- 
View this message in context: http://www.nabble.com/T5%3Aremember-the-loginned-user-tf4354440.html#a12407860
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: T5:remember the loginned user

Posted by Josh Canfield <jo...@thedailytube.com>.
>
> Try to jsessionid into your client cookie then access your page like this
> http://host:80/
> <virtual_directory>/user/list;jessionid=owruoqweruqweruqwer0283434
> You will see the data which you just save in session.


Adding jsessionid to your cookie will only work as long as your session is
active, which doesn't actually add longevity. You need to store something in
your cookie that you can use to identify the user and validate that the
cookie has not been tampered with. Don't store username/password in the
cookie because this will eventually expose your users' username/password via
some browser hole.

One approach would be to store in the cookie the users loginid and then
separately a secure hash (md5?) with the users loginid, ip address and a
secret key (pick a long string). When you get the cookie on the server side
you can extract the login id and the hash. Rehash the loginid, the request
ip and the same secret key. If you get a match then you can log the user in,
otherwise present the login form with their loginid pre-populated.

This assumes that you aren't logging in to a third party system where you
must know the users actual password. If this is the case then you should
consider storing the password in your database so that you can retrieve and
use it with the previous cookie method. Storing login/password in the users
browser is a bad thing.

Josh


On 8/30/07, Allen Guo <el...@gmail.com> wrote:
>
> Angelo Chen 写道:
> > Hi,
> >
> > In my program I'd verify the user and create an ASO until he log out or
> the
> > ASO expires. Now I'd like to add an option: 'remember me' like the one
> in
> > yahoo, if checked, program will automatically login the user next time,
> how
> > to achieve this? thanks.
> >
> > A.C.
> >
> Try to jsessionid into your client cookie then access your page like this
> http://host:80/
> <virtual_directory>/user/list;jessionid=owruoqweruqweruqwer0283434
> You will see the data which you just save in session.
>
> Try it, I'm not sure if it can work.
>
> Good Luck
> Guoguo Long
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
--
TheDailyTube.com. Sign up and get the best new videos on the internet
delivered fresh to your inbox.

Re: T5:remember the loginned user

Posted by Allen Guo <el...@gmail.com>.
Angelo Chen 写道:
> Hi,
>
> In my program I'd verify the user and create an ASO until he log out or the
> ASO expires. Now I'd like to add an option: 'remember me' like the one in
> yahoo, if checked, program will automatically login the user next time, how
> to achieve this? thanks.
>
> A.C.
>   
Try to jsessionid into your client cookie then access your page like this
http://host:80/<virtual_directory>/user/list;jessionid=owruoqweruqweruqwer0283434
You will see the data which you just save in session.

Try it, I'm not sure if it can work.

Good Luck
Guoguo Long

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org