From: scot at goldentroll dot com
Operating system: Apache
PHP version: Irrelevant
PHP Bug Type: Session related
Bug description: SID's appended to relative links upon first view regardless of cookies availabl

Description:
------------
I am using the latest stable release 4.2.3
php_ini - session.use_trans_sid = on

Session id's are being appended to all relative links upon first view
regardless if cookies are available or not.

I can't read a cookie that has been set until the page is reloaded.


Reproduce code:
---------------
session_start();
if (!$PHPSESSID)){
// PHPSESSID is the session name-hence name of variable set in
session_start
ini_set('session.use_trans_sid', true);
}else {
ini_set('session.use_trans_sid', false);
}


Expected result:
----------------
I would like to know if cookies are available to a page when it loads. I
wish PHP did not append the links unless cookies are not available to
store the session id and value

Actual result:
--------------
(!$PHPSESSID) will always be true until the page is reloaded.

--
Edit bug report at [url]http://bugs.php.net/?id=24572&edit=1[/url]
--
Try a CVS snapshot (php4): [url]http://bugs.php.net/fix.php?id=24572&r=trysnapshot4[/url]
Try a CVS snapshot (php5): [url]http://bugs.php.net/fix.php?id=24572&r=trysnapshot5[/url]
Fixed in CVS: [url]http://bugs.php.net/fix.php?id=24572&r=fixedcvs[/url]
Fixed in release: [url]http://bugs.php.net/fix.php?id=24572&r=alreadyfixed[/url]
Need backtrace: [url]http://bugs.php.net/fix.php?id=24572&r=needtrace[/url]
Try newer version: [url]http://bugs.php.net/fix.php?id=24572&r=oldversion[/url]
Not developer issue: [url]http://bugs.php.net/fix.php?id=24572&r=support[/url]
Expected behavior: [url]http://bugs.php.net/fix.php?id=24572&r=notwrong[/url]
Not enough info: [url]http://bugs.php.net/fix.php?id=24572&r=notenoughinfo[/url]
Submitted twice: [url]http://bugs.php.net/fix.php?id=24572&r=submittedtwice[/url]
register_globals: [url]http://bugs.php.net/fix.php?id=24572&r=globals[/url]
PHP 3 support discontinued: [url]http://bugs.php.net/fix.php?id=24572&r=php3[/url]
Daylight Savings: [url]http://bugs.php.net/fix.php?id=24572&r=dst[/url]
IIS Stability: [url]http://bugs.php.net/fix.php?id=24572&r=isapi[/url]
Install GNU Sed: [url]http://bugs.php.net/fix.php?id=24572&r=gnused[/url]