The SID will only be added automatically if -enable-trans-sid is set and
your browser has cookies switched off.  When cookies are on the session id
is propagated using a cookie.  So likewise the <?=SID?> constant will only
be expanded when cookies are switched off.

Anyway, yes you will have to add <?=SID?> to all your URL's if you want
people to be able to access it with cookies disabled.  Plus you will need to
add a hidden field on all your forms i.e. 
<INPUT TYPE="HIDDEN" NAME="TESTSESSID" VALUE="<?php echo session_id()?>"> so
that the session_id is propagated when ther form is submitted.

When you changed you session_name did you remember to call session_start
again.

session_name("TESTSESSID");    // session i want to use
session_start();               // start specified session.

-Stewart


-----Original Message-----
From: Jennifer [mailto:[EMAIL PROTECTED]]
Sent: 29 April 2001 09:51
To: [EMAIL PROTECTED]
Subject: [PHP] Sessions


I have been doing a few test pages trying to figure out how
sessions work.

The SID is not being automatically added to my urls so I assume
that means that php was not compiled with -enable-trans-sid  (I'm
on a virtual server so I can't access php.ini)

So that means that I need to add <?=SID?> to all my urls,
correct?

Can I change the value of session_name() and still have the above
work for the new session name?

I tried it and the session_name was changed to the new value, but
then SID seemed to be empty after that.  Is there something I am
missing or is that the way it is supposed to work?

Jennifer

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to