I'm checking for the existence of sessions in the first lines of every
script (to avoid any header problems) as indicated below...
<?php
session_start();
session_register('this_session_mode');
session_register('this_session_name');
session_register('this_session_user');
echo session_id()."<br>";
// rest of script....
With cookies enabled, this works... state is maintained when visitors
traverse the site.
However, I want the site to work for cookie-less browsers too, and so
appended the SID to relevant relative URLS in the site, as below...
<a href="show_details.php?<?php echo (SID)?>">
AND to any <form> elements in the site with the following construct...
echo '<input type="hidden" name=sid value="' . session_id() . '">';
The problem is this... session_start() isn't recognising the session_id that
is being passed back to the page via URL or hidden form values... why?
This is the config info from php_info()
'./configure' '--with-config-file-path=/usr/local/lib'
'--with-mysql=/usr/local' '--with-apache=../apache_1.3.9'
'--enable-track-vars' '--enable-safe-mode'
These are the relevant session values (PHP is Version 4.0.1pl2)
Session Support enabled
Directive Local Value Master Value
session.auto_start Off Off
session.cache_expire 180 180
session.cache_limiter nocache nocache
session.cookie_domain no value no value
session.cookie_lifetime 0 0
session.cookie_path / /
session.entropy_file no value no value
session.entropy_length 0 0
session.gc_maxlifetime 1440 1440
session.gc_probability 1 1
session.name PHPSESSID PHPSESSID
session.referer_check no value no value
session.save_handler files files
session.save_path /tmp /tmp
session.serialize_handler php php
session.use_cookies On On
I'm on a commercial ISP and don't have permission to build / configure PHP
myself (otherwise, I believe --enable-trans-sid would solve my problems!).
Many thanks for your time
Adam