Page 1 of 1

Strange session behavior.

Posted: Sun Jun 08, 2008 5:18 am
by hickscorp
Hello people,

i have since this morning on my server a problem.
Each time i refresh a page which calls "session_start()", a new "sess_*" file is created in the server's /tmp folder, and it obviously avoids the session to be "stuck" to a cookie.

What can be wrong in my set up?
Thanks,
Pierre.

Re: Strange session behavior.

Posted: Sun Jun 08, 2008 11:57 am
by Ambush Commander
Is your browser accepting session cookies? If you have a named session, have you called session_name()? What's the value of session_id() in your script?

Re: Strange session behavior.

Posted: Sun Jun 08, 2008 12:09 pm
by hickscorp
My browser is accepting cookies, like the 3 others browsers i have tried on 2 different computers.
Session ID is unchanged (i think the default is PHPSESSID, set up in my /usr/local/lib/php.ini...
Also, i never call session_name in any of my scripts.

I have made several tries with / without overridding session ID and name, and the result is the same.

[EDIT] The strange thing is that it wasn't behaving like this yesterday... i'm wondering, can it be an O.S. related problem? i'm running apache 2.2.8 / php 5.2.6 both compiled from sources...[/EDIT]

Thanks for your help,
Pierre.

Re: Strange session behavior.

Posted: Mon Jun 09, 2008 4:43 am
by hickscorp
Up?...

i have reinstalled my whole system, becase my HDD was dead.
So new HDD, new apache / php compiled from source, same problem.
i have created a very basic test page Test.php, which only does "session_start();".
When i access the page, i see a file named "sess_92a1d5255e7d85e34a42aba4aa422f83" appearing in my /tmp.
If i just reload the page, another one is created, "sess_94cd5580871613484b5f78a2336451de"...

i have tried either with ini settings from php-recommended, php-dist and no php.ini...
I would really apperciate help on this please :)

Thanks,
Pierre.

Re: Strange session behavior.

Posted: Mon Jun 09, 2008 7:00 pm
by Ambush Commander
Out of curiosity: try modifying $_SESSION, and see if the change carries over. Other than that, I don't know why you're seeing this behavior. (Maybe PHP is supposed to work like that?)

Re: Strange session behavior.

Posted: Tue Jun 10, 2008 4:43 am
by hickscorp
When i set anything inside $_SESSION, the variable is obviously wrote thru the sess_* file. But since when i reload the page another file is created, $_SESSION is empty.