[Xitami] PHP anyone?
Paul N Shortis
xitami@lists.xitami.org
Wed, 16 Oct 2002 09:52:11 +1000
I have used sessions with Xitami without any problems. Since you can see the
session cookie value it would appear that Xitami and the browser are doing their
job, so you would appear to have a PHP or coding problem.
I have always named my sessions, never used the default session name. It would
appear that although you have a cookie named PHPSESSID session_start() isn't
using 'PHPSESSID' for it's session name. Try using the function
session_name('YOUR_SESSSION_NAME'); // make up your own session name
obviously
before each call to session_start() to force your own session cookie name.
Best of luck, Paul
"Stephen Edmonds" <stephen.edmonds5@btinternet.com> on 16/10/2002 01:51:37 AM
Please respond to xitami@lists.xitami.org
To: xitami@lists.xitami.org
cc: (bcc: Paul N Shortis/Roads/QMR/Au)
Subject: [Xitami] PHP anyone?
If you know much about PHP, read below. Else wise, ignore this and go have a
cup of nice hot tea/coffee :-)
The problem is my sessions don't work properly... the ID is stored and saved
in the cookie fine, and the PHP script can even acces the Session ID value
in the cookie. However, when you call session_start(); it mearly creates a
new session/session ID instead of resuming.
I can pass on the session id using
$target = "http://url.com?".CID;
header( "Location: $target" );
but obviously doing that is not what I want to do for every page/link. I
wrote a script to test the session function. The sessions are set in a
script using session_register() and the variables are stored perfectly fine
in the session folder, even the session ID's match with the output of CID.
The Code:
print "Session ID = ".session_id()."<br>";
print "Searching for cookie ID ( $_ENV[COOKIE] ) <br>";
Firstly, I called the code before session_start(); just to see what happens.
It returns:
Session ID =
Searching for cookie ID ( PHPSESSID=7c7b9b50c724fc18c59c436d78b4992d )
Remember, thats before I call session_start();
However, Exactly the same code used after session_start(); returns something
different...
Session ID = e6c9f37a45808b552b8f04ee06968d42
Searching for cookie ID ( PHPSESSID=7c7b9b50c724fc18c59c436d78b4992d )
So, as you can see, Session_Start(); has actually started a NEW session
rather than the old session refered to in the session cookie. This is most
annoying... and I have no idea what could be causing it.
Thank you for your time. I hope I have explained it fairly well...
Stephen
[Web Server Details]
Platform - Windows XP (Admin Account)
Server - Xitami
[PHP.INI File]
register_globals = On
[Session]
session.save_handler = files
session.save_path = C:\server\PHP\sessiondata ; argument passed to
save_handler
session.use_cookies = 1
session.name = PHPSESSID
session.auto_start = 0
session.cookie_lifetime = 1800
session.cookie_path = /
session.cookie_domain =
session.serialize_handler = php
session.gc_probability = 1
session.gc_maxlifetime = 1800
session.referer_check =
session.entropy_length = 0
session.entropy_file =
;session.entropy_length = 16 (Yes, they are commented out ; in php.ini)
;session.entropy_file = /dev/urandom (Yes, they are commented out ; in
php.ini)
session.cache_limiter = nocache
session.cache_expire = 180
session.use_trans_sid = 0
url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=fakeentry
--
Xitami Users Mailing List -- For Xitami support
To unsubscribe: http://lists.xitami.org/mailman/listinfo/xitami
************************************************************
Opinions contained in this e-mail do not necessarily reflect
the opinions of the Queensland Department of Main Roads,
Queensland Transport or National Transport Secretariat, or
endorsed organisations utilising the same infrastructure.
If you have received this electronic mail message in error,
please immediately notify the sender and delete the message
from your computer.
************************************************************