when I run this code for the first time
<?php
session_start();
echo SID;
?>
, I get some thing like:
PHPSESSID=9o2bhrqmln2j52caspdhholhk7
but when I refresh I get a blank page
Until I remove the PHPSESSION cookie and start a new one ... is that normal or I have a problem ?
The manual says:
Alternatively, you can use the constant
SIDwhich is defined if the session started. If the client did not send an appropriate session cookie, it has the formsession_name=session_id. Otherwise, it expands to an empty string. Thus, you can embed it unconditionally into URLs.
It's not meant to contain the session id, it's meant to be attached to URLs if cookies are disabled.
Yes, it is normal. this constant being populated only when no cookie present. Why do you think you have any problem? What's the use of this constant anyway?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With