Re: Reliability of sessions
| From: | Michael Virnstein | Date: | Fri, 05 Apr 2002 10:20:58 +0000 |
| Subject: | Re: Reliability of sessions | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-91672@lists.php.net to get a copy of this message | ||
On the page you start the session,
${session_name()} isn't set. so if you need that on the first page too, you
should do the following
<?php
session_start();
if (!isset(${session_name()})) {
${session_name()} = session_id();
}
?>
"Thomas Deliduka" <thomas@neweve.com> schrieb im Newsbeitrag
news:B8D23D74.7064%thomas@neweve.com...
I use them because 'sid' isn't always populated and, who knows, some browser
may not handle cookies right and then lose a session. I do it to make sure,
to be absolutely sure that it will work.
On 4/4/02 5:19 PM this was written:
> If you made your link like this: <a href="filename.php?<?=sid?>"> it
tacks
> on the name plus the session id. If cookies are enabled you will only see
> the session id passed through the url on the first page.. After that you
> wont, thus the little script I wrote so the '?' doesn¹t show up. Now if
> cookies arent enabled you will see the session name and id passed through
> the url every single time. There is absolutely no reason to use those
> functions since php takes care of that stuff for you.
--
Thomas Deliduka
IT Manager
-------------------------
New Eve Media
The Solution To Your Internet Angst
http://www.neweve.com/