RE: [PHP] Sessions
| From: | ed at home dot homes2see dot com | Date: | Thu, 24 Oct 2002 08:20:38 +0000 |
| Subject: | RE: [PHP] Sessions | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-121241@lists.php.net to get a copy of this message | ||
Now we're on another topic I don't quite understand. I would like to use
session as well at some point to store say a user id so that a person
could carry it with them from page to page then when they logout the
session is killed or deleted after an expiration if they browse to an off
site location without doing a logout.
If I use session_start() after someone authenticates I should then be able
to do session_register('$id') and that persons username is kept as a
record in that person's session. Now comes the part I don't quite
understand. As far as I have tested the above, I can then go to a seperate
page and do session_start() again and be able to pull the $id variable
from that session. As far as I can tell this is all done server side
without cookies or doing anything with the session id in the URL. How does
PHP know that a specific session is this or that person's session?
Thanks,
Ed
On Thu, 24 Oct 2002, Jon Haworth wrote:
> Hi Shaun,
>
> > I have to make a site witch allows users to login.
> > I `m going to have to go with sessions on this one.
>
> Yup, it's your best bet.
>
> > If i dont want to use cookies(not all browsers support
> > it) , i know i can use the sid(get) in the url. But
> > that would be unsafe as important info can be retreived
> > by wrong people. Is there any other way ?
>
> Not that I know of - if you don't have the SID in the URL, and you don't
> have it as a cookie, how are you proposing to get it to the next page?
>
> Why don't you use cookies for those that support them, and trans-sid for
> those that don't? There's nothing inherently evil about cookies, especially
> session-based ones.
>
>
> Cheers
> Jon
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>