This is a discussion on PHP & SESSION problems within the alt.comp.lang.php forums, part of the PHP Programming Forums category; I've never had problems with SESSIONS until now. It seems that I can't set SESSIONS at all. Here'...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
I've never had problems with SESSIONS until now. It seems that I can't set
SESSIONS at all. Here's my test scripts: I'm trying to set a session in ANY way in this script. I redirect to another script which should show ANY sessions, but nothing is in either $HTTP_SESSION_VARS or $_SESSION. What gives? <? session_start(); $HTTP_SESSION_VARS["TEST1"] = "TEST1"; $_SESSION["TEST2"]="TEST2"; session_register("TEST3"); $TEST3 = "MY TEST"; header("Location: test2.php"); ?> ##should show sessions, but there's nothing. What's going on? <? session_start(); print_r($HTTP_SESSION_VARS); print_r($_SESSION); ?> Here session info I got from phpinfo(). session Session Support enabled Registered save handlers files user mm Directive Local Value Master Value session.auto_start Off Off session.bug_compat_42 Off Off session.bug_compat_warn On On 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.cookie_secure Off Off session.entropy_file no value no value session.entropy_length 0 0 session.gc_dividend 1000 1000 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 /vservers/valuenews/tmp /tmp session.serialize_handler php php session.use_cookies On On session.use_only_cookies Off Off session.use_trans_sid Off Off |
|
|||
|
Billy wrote:
> I've never had problems with SESSIONS until now. It seems that I can't set > SESSIONS at all. > > Here's my test scripts: > > I'm trying to set a session in ANY way in this script. I redirect to another > script which should show ANY sessions, but nothing is in either > $HTTP_SESSION_VARS or $_SESSION. > > What gives? > > <? > > session_start(); > "short_open_tag = Off" in your php.ini? :P -- <nospam> Email: frank.at.fake.eu.org </nospam> ========================== |
|
|||
|
I found the problem.
- Sessions are written to a file on the server - The default path is /tmp/ Sessions were not being written to the folder. Fixed folder permissions etc... and it works now. "frankly" <frank@dev.null> wrote in message news:bkv4c3$b9u$2@hermes.castel.nl... > Billy wrote: > > > I've never had problems with SESSIONS until now. It seems that I can't set > > SESSIONS at all. > > > > Here's my test scripts: > > > > I'm trying to set a session in ANY way in this script. I redirect to another > > script which should show ANY sessions, but nothing is in either > > $HTTP_SESSION_VARS or $_SESSION. > > > > What gives? > > > > <? > > > > session_start(); > > > "short_open_tag = Off" in your php.ini? :P > > -- > <nospam> > Email: frank.at.fake.eu.org > </nospam> > ========================== > |