note 15906 added to function.session-id

From: Date: Mon, 08 Oct 2001 13:25:37 +0000
Subject: note 15906 added to function.session-id
Groups: php.notes 
Request: Send a blank email to php-notes+get-18677@lists.php.net to get a copy of this message
something to consider (workaround), using the global variable SID: using a string like 1) "sid=".session_id() 2) SID .. should produce the same results (if you set "session.name=sid" in php.ini) consider these lines of code: session_start(); $send = $PHP_SELF . "?" .session_id(); echo "SID is .. " , SID; echo "send is .. " , $send; I am developing under conectiva linux using opera 5.5, konquerer and netscape .. opera and netscape produce the following (correct) output: SID is .. sid=cf3706ad938616f9e4f3150ae5906c5d send is .. /konquerer_test.php?sid=cf3706ad938616f9e4f3150ae5906c5d konquerer (v1.9.8 KDE2) does not (!!) : SID is .. send is .. /konquerer_test.php?7f0bb576ce6f303c09a23ed5d6c99ba1 ==>> meaning SID is empty, therefore if the user has cookies disabled, a _new_ session will start in another script instead of re-establishing the old session. I have no idea why PHP4 will not set SID in this case - but if you attach SID in href's to URLs, better use session_id() instead to be on the safe side: echo "<href='url?='" . session_id(); instead of echo "<href='url'" . SID; -- http://www.php.net/manual/en/function.session-id.php http://master.php.net/manage/user-notes.php?action=edit+15906 http://master.php.net/manage/user-notes.php?action=delete+15906 http://master.php.net/manage/user-notes.php?action=reject+15906

« previous php.notes (#18677) next »