|
Posted by Balazs Wellisch on 01/21/06 05:04
"pek" <kimwlias@gmail.com> wrote in message
news:1137806148.178510.59470@z14g2000cwz.googlegroups.com...
> Any ideas on how to create a remember me option in a login box..?
>
You need to save an ID, something you can use to identify users by, to a
cookie. Something like...
$setcookie( 'userId', $userID );
Then when they come back check for the value in the cookie structure.
if (isset( $_COOKIE['userId'] ))
{
$userId = $_COOKIE['userId'];
}
But, you have to be careful with the security risk this creates. At least
make sure that $userId is not a sequential number so it can't be faked to
gain unathorized access to someone else's records.
Balazs
Navigation:
[Reply to this message]
|