Whenever you start a function using session_name('name') and then
session_start() the sessions name will automatically be the session name.
There is no need for those functions.

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.

Rick

"Finish each day and be done with it. You have done what you could; some
blunders and absurdities have crept in; forget them as soon as you can.
Tomorrow is a new day; you shall begin it serenely and with too high a
spirit to be encumbered with your old nonsense." - Ralph Waldo Emerson

> From: Thomas Deliduka <[EMAIL PROTECTED]>
> Date: Thu, 04 Apr 2002 17:09:20 -0500
> To: PHP List <[EMAIL PROTECTED]>
> Subject: Re: [PHP] Reliability of sessions
> 
> On 4/4/02 4:56 PM this was written:
> 
>> How do you pass session IDs via strings? Can you describe in few words
>> please?
> 
> Well, I know that SID is a defined constant (see session functions in the
> online PHP manual) but just to be sure, I created my own functions:
> 
> function sessinfo() {
>   return session_name() . "=" . session_id();
> }
> 
> function sessfield() {
>   echo "<INPUT TYPE=\"HIDDEN\" NAME=\"" . session_name() . "\" VALUE=\"" .
> session_id() . "\">\n";
> }
> 
> 
> I use 'session_name()' rather than PHPSESSID because some webmasters may
> change the PHP.ini file's definition for the session name.
> 
> Then whenever I make a URL link in my site I do
> 
> <A HREF="filename.php?<? echo sessinfo(); ?>">my link</A>
> 
> Of course, the sessfield function is for passing the session ID via a form.
> 
> -- 
> 
> Thomas Deliduka
> IT Manager
>    -------------------------
> New Eve Media
> The Solution To Your Internet Angst
> http://www.neweve.com/
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to