I had EXACTLY the same problem about a month a go, but using IIS on Win2k.
The session file contains only ":foo|", so it's just the same.
There are a couple of things to check:
        1. Make sure the browser is receiving the cookie.
        2. Make sure the browser is returning the cookie (should appear using
phpinfo()).
        3. Make sure a file named with the value of the PHPSESSID cookie exists on
the server.

I solved the problem by turning off session.auto_start on php.ini and then
using the following code to start the session:

function MySetCookie
($CkyName, $CkyVal, $exp, $pth, $Domain)
{ 
        $exp = strftime("%A, %d-%b-%Y %H:%M:%S", $exp); 
        $cookiestr = sprintf ("%s=%s; domain=%s; path=%s; expires=%s", 
        $CkyName, $CkyVal, $Domain, $pth, $exp); 
        $mycky = (isset($mycky) ? "$mycky\n" : "")."Set-Cookie: $cookiestr"; 
        header($mycky); 
} 
session_start();
MySetCookie("PHPSESSID",session_id(),0, "/", "");

Make sure this code appears before any header is sent, that is, before any session, 
cookie or header instruction.
If you do all this and still have the same problem, try registering each session 
variable that you are going to use just after starting the session. I don't know why, 
but sometimes PHP requires all session variables registered before you can access 
their values.

Hope it's been of some help.
Cheers, 
Diego.



-----Original Message-----
From: Tjelvar Eriksson [mailto:[EMAIL PROTECTED]]
Sent: Monday, 25 June, 2001 7:09 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Session-problems in linux


Hi everyone,
I can't get the sessions working in linux.

I changed:
/usr/local/lib/php.ini session.auto_start = 1

so when the browser go to the page, a cookie is recieved.

In the /tmp-dir a file is created and everything looks great.

However, when I register a variable and set it to a value,
only the name, not the value is stored. I've tried to store
strings, arrays, integers but no luck.

I do:
session_register("foo");
$foo="Great day";

and the file will only contain ":foo|" with no accompanying value.

I'm really stuck here, and everything works fine in windows
but not in RH7.1. I would be very greatful for any hints here.

/t eriksson




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to