Sessions save path problem

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
RandomEngy
Forum Contributor
Posts: 173
Joined: Wed Jun 26, 2002 3:24 pm
Contact:

Sessions save path problem

Post by RandomEngy »

I upgraded to 4.2.2 today, and suddenly my server doesn't remember session variables past the page they were declared. I'm running on a windows machine, and to update I unzipped the folder for 4.2.2 and overwrote files to update from 4.2.1 . Was this the wrong way?

I've got a session_start(); at the top of every page, and declare a session variable

Code: Select all

$_SESSIONї'test'] = "foo";
When I link to another page, it doesn't know what $_SESSION['test'] is.

Is there any good way to fix this? Maybe some of the old files from 4.2.1 are interfering. Would a re-install of PHP help? Maybe a setting I need to change? Thanks.
Last edited by RandomEngy on Tue Jul 23, 2002 4:18 pm, edited 1 time in total.
User avatar
RandomEngy
Forum Contributor
Posts: 173
Joined: Wed Jun 26, 2002 3:24 pm
Contact:

Post by RandomEngy »

Just found this comment on session_start() at php.net:
Someone asked about session_start being an undefined function earlier. A few linux distributions have made the move of separating the session code out from the core php code as of php4.2.1 . So if you have upgraded your core php rpm and sessions aren't working anymore, you have to go find a separate rpm for php-session - and then specifically turn it on as a DSO in your apache conf files. Same with several other packages.
Maybe this is it? If so, how do I do what he suggested?
User avatar
RandomEngy
Forum Contributor
Posts: 173
Joined: Wed Jun 26, 2002 3:24 pm
Contact:

Post by RandomEngy »

Excellent! Found out what was wrong. It wasn't PHP 4.2.2 at all! While I was installing PHP 4.2.2 I deleted a defunct PHP folder, and that just happened to be the session.save_path target.

Now a new problem: I can't get the save path to change to what I want it to be. I have session.save_path = "c:/php4/sessiondata" in my php.ini in my C:\Windows\System folder but when I restart the server and run phpinfo again, the save path is still pointing to the defunct folder.

Thanks.
User avatar
hob_goblin
Forum Regular
Posts: 978
Joined: Sun Apr 28, 2002 9:53 pm
Contact:

Post by hob_goblin »

try searching for more php.ini files on your system
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

The php.ini (on Win 9x/XP) is normally stored in C:\Windows not C:\Windows\system. Maybe you've got two like hob_goblin said?

Mac
User avatar
RandomEngy
Forum Contributor
Posts: 173
Joined: Wed Jun 26, 2002 3:24 pm
Contact:

Post by RandomEngy »

Ahh that fixed it, thanks.
Post Reply