RE: [PHP] php sessions question
| From: | Reinhart Viane | Date: | Fri, 22 Oct 2004 05:16:28 +0000 |
| Subject: | RE: [PHP] php sessions question | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-200057@lists.php.net to get a copy of this message | ||
>I normally do as you have suggested here - but why do you suggest that
>this method is better?
>
>
One reason is for security. You cannot ever rule out the possibility of
a user injecting someone else's data into the session to get access to
information that he should not have. Of course he can fake the userid
too. That's why each time you retrieve the userid from the session you
should check if that id has been logged in. I do this (so do many
others) by keeping two column table with session id and userid in it.
--
Raditha Dissanayake.
Do you have an example or dou you know of any tutorials where this
method is used?
Thx
Reinhart