Re: LiveUser externalValues?
| From: | roehr at zilleon dot com | Date: | Wed, 23 May 2007 15:45:52 +0000 |
| Subject: | Re: LiveUser externalValues? | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-46863@lists.php.net to get a copy of this message | ||
>Hi,
>
>I just wonder what is the use of LiveUser::setExternalValues() and
>LiveUser::externalValuesMatch() ?
>
>I can not understand from the doc comments.
>
>Thanks.
>
>Regards,
>Matthias
Hi Matthias,
this is a way to hinder/complicate session hijacking. You can define any kind of values like the
user's ip address, user agent, charset whatever. This will be stored in the session on
successful login and then validated with the current values on each page request. When the values
that were stored on login do not match with the current values, the user will be denied access.
You can define it in the config for the auth container like this:
'externalValues' => array('values' => $_SERVER, // any kind of array
'keysToCheck' => array('HTTP_USER_AGENT')) // keys
existent in the array from above
This means the user agent will be compared to the value in $_SERVER on each page request after the
login.
You don't need to rely on $_SERVER, you can also use values of your own.
Best regards,
Torsten