1. 'session.save_path' is set to 'c:\php\sessiondata'
I watched that directory & this is what I found:
Example1 For each page I call session_start(), a new session file gets created. So: call a page, file gets created checking, say, $_SESSION['username']. nothing there, so call login page. After login is submitted, another file gets created while registering session vars. Next go back to original page, another session file gets created checking for, say $_SESSION['username'] existence. Since another session is created, that variable is null.
Example2: I ini_set('session.auto_save', '1'), & session_start() once (one session file gets created). But then when I return to the original page (no session_start() should be needed?), the $_SESSION['username'] ends up being null again.
From my unix experience with sessions, there should only be one file created & reused (in both examples), right?


2. I actually use $_SESSION['name'], mine ($SESSION['any_var']) was a typo.

Having these examples of what I've tried, do you have any idea what could possibly be going wrong here? Or do you have any ideas on what I could try to get around this problem?

Thanks,

Greg


Bill Liao wrote:


Hi,
1. check php.ini session.save_path
2. $SESSION['any_var'] should be $_SESSION['any_var']


----- Original Message ----- From: "Gregory Kaczmarczyk" <[EMAIL PROTECTED]>
Newsgroups: php.windows
To: <[EMAIL PROTECTED]>
Sent: Friday, April 04, 2003 2:13 PM
Subject: sessions problems





New to windows/PHP!
I'm having quite a bit of trouble with getting sessions to work right. I've got PHP 4.3.1 installed on Windows 2000 with IIS. php.ini is default from installation.
Each time I run session_start(), a new session is created disgarding the previous page's session. If I call ini_set('session.auto_start', '1'), the next page returns a $SESSION['any_var'] as nothing.
How can I get the session to "stick"?


If anyone needs more info on the configuration, please let me know.

Thanks for any/all help!

Greg











--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to