I really didn't know where to put this so hopefully this section works.
Anyway, I have been having a problem recently. I have Windows XP Pro, IIS 5 (I believe; whatever comes on Windows XP), newest stable version of both PHP and MySQL. When I view a page on my computer (localhost) the session don't work. The session variables are not carried over from the last page. Do I have a setting wrong? Is this a known problem.
I really am in a bind so anything would be helpful. Thanks!
Session Problem
Moderator: General Moderators
- partiallynothing
- Forum Commoner
- Posts: 61
- Joined: Fri Nov 21, 2003 5:02 pm
- Location: connecticut, usa
Do you have session_start(); at the top of every page?
Like this:
If you do, and it's still not working, post some code, there could be other problems.
Like this:
Code: Select all
<?php
session_start();
//rest of the code for that page
?>- partiallynothing
- Forum Commoner
- Posts: 61
- Joined: Fri Nov 21, 2003 5:02 pm
- Location: connecticut, usa
-
microthick
- Forum Regular
- Posts: 543
- Joined: Wed Sep 24, 2003 2:15 pm
- Location: Vancouver, BC
- dyconsulting
- Forum Newbie
- Posts: 14
- Joined: Mon Dec 01, 2003 6:52 pm
- Location: San Francisco
session.save_path is missing from php.ini
You are missing a directory where session info is stored. PHP will not create this directory structure automatically.
Your code is fine. All you have to do is open php.ini file and look for :
session.save_path. Change it to session.save_path=C:\PHP\sessiondata (provided you have created that folder first).
Your code is fine. All you have to do is open php.ini file and look for :
session.save_path. Change it to session.save_path=C:\PHP\sessiondata (provided you have created that folder first).
Re: session.save_path is missing from php.ini
Just wondering how you know that from the post above.dyconsulting wrote:You are missing a directory where session info is stored. PHP will not create this directory structure automatically.
Your code is fine. All you have to do is open php.ini file and look for :
session.save_path. Change it to session.save_path=C:\PHP\sessiondata (provided you have created that folder first).
@partiallynothing:
"It doesn't work"; There can be 1-100's of reason for this. Could you paste error-messages (if any) and perhaps some code? Bump up the error level on yo localhost to E_ALL (max) just to be sure that you know that you are not supressing any errors generated...
- dyconsulting
- Forum Newbie
- Posts: 14
- Joined: Mon Dec 01, 2003 6:52 pm
- Location: San Francisco