Re: Newbie - Can't get sessions to work
| From: | Marek Kilimajer | Date: | Thu, 23 Oct 2003 10:21:09 +0000 |
| Subject: | Re: Newbie - Can't get sessions to work | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-167246@lists.php.net to get a copy of this message | ||
If you want to check for cookie add
echo "cookie = ".$_COOKIE[session_name()];
to the second page.
To check if transparent sessions are enabled look into phpinfo() output -> session.use_trans_sid
Shaun Campbell wrote:
I've tried the suggested code changes and no difference :( I just don't think sessions are working for me at all. I said in my original posting that the second page was creating an empty file in my session.save_path directory as though the second page has no reference to the first one. In my save_path directory I have the following files:sess_8e603c46412d9c4dd3fa6bf3d98c100f 0 KB File 23/10/2003 10:37 sess_f548763ea84f7d812539720142ac6efe 1 KB File 23/10/2003 10:37The top one presumably created by page 2 is empty and the bottom one contains foo|s:5:"Hello";bar|s:5:"World"; I don't know how sessions work in php and whether they use cookies or not but it seems to me that the session_start() on page 2 is creating a new session instead of referring to the current one. Jason how do I check for those settings? I see nothing in php.ini that refers to transparent sessions and I believe my browser is accepting cookies. Could it be an Apache configuration issue? I thought sessions were maintained on the server somehow. Thanks Shaun "Jason Wong" <php-general@gremlins.biz> wrote in message news:200310230449.36878.php-general@gremlins.biz...On Wednesday 22 October 2003 22:08, Shaun Campbell wrote:couldI've got a problem getting sessions to work and I wondered if anyoneandoffer any advice. The example I am using is to get one page to set variables in a sessiontothen use another page to retrieve them. I am using 4.3.4RC2 and priorbrowserthat 4.3..3 on Win2k with IE6 and Apache 1.3.22.The code is:[snip] Code looks OK. One explanation: you have not enabled transparent sessions, and youris not accepting cookies. -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * ------------------------------------------ Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general ------------------------------------------ /* Sturgeon's Law: 90% of everything is crud. */