Re: [PHP] PHP not remembering sessions

2003-10-23 Thread Daniel Guerrier
Use
$_SESSION['var']

instead of

$_SESSION[var]
--- Golawala, Moiz M (IndSys, GE Interlogix)
[EMAIL PROTECTED] wrote:
 Hi All, 
 
 I have a problem with PHP not remembering sessions.
 for example:
 
 in page1.php:
 
 ? session_start();
 $_SESSION[var] = Please help; ?
   form action=sessionTest2.php method=post
   input type=text name=loopCount size=21,
 maxlength=20/td 
   input type=submit value=Submit/td   
 
 
 in page2.php
 ? session_start();
 echo $_SESSION[var];
 echo $_POST[loopCount];
 ?
 
 what I see above is only data for loopCount. I am
 not able to see the Please help on page2
 
 I noticed that 2 cookies were created one for each
 session start. When I opened one of the cookies, I
 noticed that the data Please help was in the
 session cookie. Somehow php thinks a session is not
 already created and starts a new session on
 page2.php.
 
 my php.ini file has:
 register_globals = off
 session.use_cookies = 1
 session.use_only_cookies = 1
 session.auto_start = 0
 session.gc_maxlifetime = 1440
 
 Please can someone help me. I am not sure what I am
 doing wrong? Maybe it is some configuration that is
 causing this issue. Any help appreciated.
 
 Thanks,
 moiz
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 


__
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com

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



RE: [PHP] PHP not remembering sessions

2003-10-23 Thread Golawala, Moiz M (IndSys, GE Interlogix)
It seems that there is a problem with the session management on windows/apache. I was 
surfing the web to find an answer, and I noticed that there are couple of other people 
who have the same problem. But alas, there were no answers posted to this problem. So 
someone, please help me if you know why this is happening.

Thanks
Moiz

-Original Message-
From: Daniel Guerrier [mailto:[EMAIL PROTECTED]
Sent: Thursday, October 23, 2003 4:04 PM
To: Golawala, Moiz M (IndSys, GE Interlogix); [EMAIL PROTECTED]
Subject: Re: [PHP] PHP not remembering sessions


Use
$_SESSION['var']

instead of

$_SESSION[var]
--- Golawala, Moiz M (IndSys, GE Interlogix)
[EMAIL PROTECTED] wrote:
 Hi All, 
 
 I have a problem with PHP not remembering sessions.
 for example:
 
 in page1.php:
 
 ? session_start();
 $_SESSION[var] = Please help; ?
   form action=sessionTest2.php method=post
   input type=text name=loopCount size=21,
 maxlength=20/td 
   input type=submit value=Submit/td   
 
 
 in page2.php
 ? session_start();
 echo $_SESSION[var];
 echo $_POST[loopCount];
 ?
 
 what I see above is only data for loopCount. I am
 not able to see the Please help on page2
 
 I noticed that 2 cookies were created one for each
 session start. When I opened one of the cookies, I
 noticed that the data Please help was in the
 session cookie. Somehow php thinks a session is not
 already created and starts a new session on
 page2.php.
 
 my php.ini file has:
 register_globals = off
 session.use_cookies = 1
 session.use_only_cookies = 1
 session.auto_start = 0
 session.gc_maxlifetime = 1440
 
 Please can someone help me. I am not sure what I am
 doing wrong? Maybe it is some configuration that is
 causing this issue. Any help appreciated.
 
 Thanks,
 moiz
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 


__
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com

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



RE: [PHP] PHP not remembering sessions

2003-10-23 Thread Pablo Gosse
Strange, because I just set up the code exactly as posted below, under
Win2K and Apache 2.0, and it worked fine.

Cheers,
Pablo

-Original Message-
From: Golawala, Moiz M (IndSys, GE Interlogix)
[mailto:[EMAIL PROTECTED] 
Sent: Thursday, October 23, 2003 1:11 PM
To: Daniel Guerrier; [EMAIL PROTECTED]
Subject: RE: [PHP] PHP not remembering sessions

It seems that there is a problem with the session management on
windows/apache. I was surfing the web to find an answer, and I noticed
that there are couple of other people who have the same problem. But
alas, there were no answers posted to this problem. So someone, please
help me if you know why this is happening.

Thanks
Moiz

-Original Message-
From: Daniel Guerrier [mailto:[EMAIL PROTECTED]
Sent: Thursday, October 23, 2003 4:04 PM
To: Golawala, Moiz M (IndSys, GE Interlogix); [EMAIL PROTECTED]
Subject: Re: [PHP] PHP not remembering sessions


Use
$_SESSION['var']

instead of

$_SESSION[var]
--- Golawala, Moiz M (IndSys, GE Interlogix)
[EMAIL PROTECTED] wrote:
 Hi All, 
 
 I have a problem with PHP not remembering sessions.
 for example:
 
 in page1.php:
 
 ? session_start();
 $_SESSION[var] = Please help; ?
   form action=sessionTest2.php method=post
   input type=text name=loopCount size=21,
 maxlength=20/td 
   input type=submit value=Submit/td   
 
 
 in page2.php
 ? session_start();
 echo $_SESSION[var];
 echo $_POST[loopCount];
 ?
 
 what I see above is only data for loopCount. I am
 not able to see the Please help on page2
 
 I noticed that 2 cookies were created one for each
 session start. When I opened one of the cookies, I
 noticed that the data Please help was in the
 session cookie. Somehow php thinks a session is not
 already created and starts a new session on
 page2.php.
 
 my php.ini file has:
 register_globals = off
 session.use_cookies = 1
 session.use_only_cookies = 1
 session.auto_start = 0
 session.gc_maxlifetime = 1440
 
 Please can someone help me. I am not sure what I am
 doing wrong? Maybe it is some configuration that is
 causing this issue. Any help appreciated.
 
 Thanks,
 moiz
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 


__
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com

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

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



Re: [PHP] PHP not remembering sessions

2003-10-23 Thread Curt Zirzow
* Thus wrote Daniel Guerrier ([EMAIL PROTECTED]):
 Use
 $_SESSION['var']
 
 instead of
 
 $_SESSION[var]

This doesn't matter.


Curt
-- 
My PHP key is worn out

  PHP List stats since 1997: 
  http://zirzow.dyndns.org/html/mlists/

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



Re: [PHP] PHP not remembering sessions

2003-10-23 Thread Dennis Sterzenbach
Pablo Gosse [EMAIL PROTECTED] wrote:
Strange, because I just set up the code exactly as posted below, under
Win2K and Apache 2.0, and it worked fine.

Cheers,
Pablo

-Original Message-
From: Golawala, Moiz M (IndSys, GE Interlogix)
[mailto:[EMAIL PROTECTED]
Sent: Thursday, October 23, 2003 1:11 PM
To: Daniel Guerrier; [EMAIL PROTECTED]
Subject: RE: [PHP] PHP not remembering sessions

It seems that there is a problem with the session management on
windows/apache. I was surfing the web to find an answer, and I noticed
that there are couple of other people who have the same problem. But
alas, there were no answers posted to this problem. So someone, please
help me if you know why this is happening.

Thanks
Moiz

-Original Message-
From: Daniel Guerrier [mailto:[EMAIL PROTECTED]
Sent: Thursday, October 23, 2003 4:04 PM
To: Golawala, Moiz M (IndSys, GE Interlogix); [EMAIL PROTECTED]
Subject: Re: [PHP] PHP not remembering sessions


Use
$_SESSION['var']

instead of

$_SESSION[var]
--- Golawala, Moiz M (IndSys, GE Interlogix)
[EMAIL PROTECTED] wrote:
 Hi All,

 I have a problem with PHP not remembering sessions.
 for example:

 in page1.php:

 ? session_start();
 $_SESSION[var] = Please help; ?
 form action=sessionTest2.php method=post
 input type=text name=loopCount size=21,
 maxlength=20/td
 input type=submit value=Submit/td


 in page2.php
 ? session_start();
 echo $_SESSION[var];
 echo $_POST[loopCount];
 ?

 what I see above is only data for loopCount. I am
 not able to see the Please help on page2

 I noticed that 2 cookies were created one for each
 session start. When I opened one of the cookies, I
 noticed that the data Please help was in the
 session cookie. Somehow php thinks a session is not
 already created and starts a new session on
 page2.php.

 my php.ini file has:
 register_globals = off
 session.use_cookies = 1
 session.use_only_cookies = 1
 session.auto_start = 0
 session.gc_maxlifetime = 1440

 Please can someone help me. I am not sure what I am
 doing wrong? Maybe it is some configuration that is
 causing this issue. Any help appreciated.

 Thanks,
 moiz



Seems strange to me, too.
Did you set the save_handler for how sessions are stored right
and the corresponding save_path (if using session.save_handler = file)?
Also notice that the save_path should be made writable to php/apache.

Between $_SESSION[var] and $_SESSION['var'] should be no difference
(except the obvious difference between the  and the ' themselves).

I can't reproduce the problem on none of my systems
(win9x, win2k, winxp, and some linux machines).

--
 Dennis Sterzenbach
 www.darknoise.de

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



Re: [PHP] PHP not remembering sessions

2003-10-23 Thread Curt Zirzow
* Thus wrote Golawala, Moiz M (IndSys, GE Interlogix) ([EMAIL PROTECTED]):
 
 I noticed that 2 cookies were created one for each session start. When I opened one 
 of the cookies, I noticed that the data Please help was in the session cookie. 
 Somehow php thinks a session is not already created and starts a new session on 
 page2.php.

I think you mean the session file had the please help not the
cookie.  The cookie will only have the session id in it.


 
 my php.ini file has:
 register_globals = off
 session.use_cookies = 1
 session.use_only_cookies = 1
 session.auto_start = 0
 session.gc_maxlifetime = 1440
 
 Please can someone help me. I am not sure what I am doing wrong? Maybe it is some 
 configuration that is causing this issue. Any help appreciated.
 

Ensure your browser is accepting cookies.  If you dont accept a
cookie on the first request then the second request will start a
whole new session without the previous data.


Curt
-- 
My PHP key is worn out

  PHP List stats since 1997: 
http://zirzow.dyndns.org/html/mlists/

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



RE: [PHP] PHP not remembering sessions

2003-10-23 Thread Vail, Warren
are you using session save handler routines?

If not make sure you have a /tmp directory on your server, in fact you can
check phpinfo() to find out what the session save directory is (provided you
are not using save handler routines).

good luck

Warren Vail

-Original Message-
From: Curt Zirzow [mailto:[EMAIL PROTECTED]
Sent: Thursday, October 23, 2003 1:30 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] PHP not remembering sessions


* Thus wrote Daniel Guerrier ([EMAIL PROTECTED]):
 Use
 $_SESSION['var']
 
 instead of
 
 $_SESSION[var]

This doesn't matter.


Curt
-- 
My PHP key is worn out

  PHP List stats since 1997: 
  http://zirzow.dyndns.org/html/mlists/

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

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



RE: [PHP] PHP not remembering sessions

2003-10-23 Thread Golawala, Moiz M (IndSys, GE Interlogix)
This is what is defined in the php.ini file for save handler routines.. I am newbie, I 
left it with default values:

session.save_handler = files
session.save_path = c:/Program Files/Apache Group/Apache2/htdocs/Alarms/

thanks
moiz


-Original Message-
From: Vail, Warren [mailto:[EMAIL PROTECTED]
Sent: Thursday, October 23, 2003 4:27 PM
To: 'Curt Zirzow'; [EMAIL PROTECTED]
Subject: RE: [PHP] PHP not remembering sessions


are you using session save handler routines?

If not make sure you have a /tmp directory on your server, in fact you can
check phpinfo() to find out what the session save directory is (provided you
are not using save handler routines).

good luck

Warren Vail

-Original Message-
From: Curt Zirzow [mailto:[EMAIL PROTECTED]
Sent: Thursday, October 23, 2003 1:30 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] PHP not remembering sessions


* Thus wrote Daniel Guerrier ([EMAIL PROTECTED]):
 Use
 $_SESSION['var']
 
 instead of
 
 $_SESSION[var]

This doesn't matter.


Curt
-- 
My PHP key is worn out

  PHP List stats since 1997: 
  http://zirzow.dyndns.org/html/mlists/

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

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

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



Re: [PHP] PHP not remembering sessions

2003-10-23 Thread Dennis Sterzenbach
Moiz M Golawala [EMAIL PROTECTED] wrote:
 This is what is defined in the php.ini file for save handler
routines..
 I am newbie, I left it with default values:

 session.save_handler = files
 session.save_path = c:/Program Files/Apache
Group/Apache2/htdocs/Alarms/

 thanks
 moiz

Change your save_path to C:/tmp
and create this directory, if it does not exist.

I never trust the blanks in directory names under windoze.


--
 Dennis Sterzenbach
 www.darknoise.de

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



RE: [PHP] PHP not remembering sessions

2003-10-23 Thread Golawala, Moiz M (IndSys, GE Interlogix)
I was surfing the web to find out if I was the only one with this strange problem and 
I found out that I was not alone.. Aparently there was a bug in php version 4.1.0 
regarding this. However there is no bugs like this noted for php version 4.3.2 (which 
is what I am running).

rgds
moiz 

-Original Message-
From: Vail, Warren [mailto:[EMAIL PROTECTED]
Sent: Thursday, October 23, 2003 4:27 PM
To: 'Curt Zirzow'; [EMAIL PROTECTED]
Subject: RE: [PHP] PHP not remembering sessions


are you using session save handler routines?

If not make sure you have a /tmp directory on your server, in fact you can
check phpinfo() to find out what the session save directory is (provided you
are not using save handler routines).

good luck

Warren Vail

-Original Message-
From: Curt Zirzow [mailto:[EMAIL PROTECTED]
Sent: Thursday, October 23, 2003 1:30 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] PHP not remembering sessions


* Thus wrote Daniel Guerrier ([EMAIL PROTECTED]):
 Use
 $_SESSION['var']
 
 instead of
 
 $_SESSION[var]

This doesn't matter.


Curt
-- 
My PHP key is worn out

  PHP List stats since 1997: 
  http://zirzow.dyndns.org/html/mlists/

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

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

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



RE: [PHP] PHP not remembering sessions

2003-10-23 Thread Vail, Warren
while this doesn't mean that save handler routines are not used, it provides
some clues.

Does the directory pointed to by the session.save_path contain session files
(they will usually have an encrypted filename)?

save handler routines are actually defined in your php files, usually
dynamically, possibly in a common include file; and they override but do not
change the settings in your php.ini file.

http://us4.php.net/manual/en/function.session-set-save-handler.php

The directory pointed to, looks suspicious since it appears that it may be
in the web space area (accessible to http:), if someone can browse that
directory with a browser, all kinds of good things might be found inside
sessions???  if your http.conf file (for apache) points to something other
than htdocs as the web root, you may be ok.

Warren

-Original Message-
From: Golawala, Moiz M (IndSys, GE Interlogix)
[mailto:[EMAIL PROTECTED]
Sent: Thursday, October 23, 2003 1:31 PM
To: Vail, Warren; Curt Zirzow; [EMAIL PROTECTED]
Subject: RE: [PHP] PHP not remembering sessions


This is what is defined in the php.ini file for save handler routines.. I am
newbie, I left it with default values:

session.save_handler = files
session.save_path = c:/Program Files/Apache Group/Apache2/htdocs/Alarms/

thanks
moiz


-Original Message-
From: Vail, Warren [mailto:[EMAIL PROTECTED]
Sent: Thursday, October 23, 2003 4:27 PM
To: 'Curt Zirzow'; [EMAIL PROTECTED]
Subject: RE: [PHP] PHP not remembering sessions


are you using session save handler routines?

If not make sure you have a /tmp directory on your server, in fact you can
check phpinfo() to find out what the session save directory is (provided you
are not using save handler routines).

good luck

Warren Vail

-Original Message-
From: Curt Zirzow [mailto:[EMAIL PROTECTED]
Sent: Thursday, October 23, 2003 1:30 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] PHP not remembering sessions


* Thus wrote Daniel Guerrier ([EMAIL PROTECTED]):
 Use
 $_SESSION['var']
 
 instead of
 
 $_SESSION[var]

This doesn't matter.


Curt
-- 
My PHP key is worn out

  PHP List stats since 1997: 
  http://zirzow.dyndns.org/html/mlists/

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

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

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



Re: [PHP] PHP not remembering sessions

2003-10-23 Thread Chris Shiflett
--- Daniel Guerrier [EMAIL PROTECTED] wrote:
 Use
 $_SESSION['var']
 
 instead of
 
 $_SESSION[var]

That won't make any difference.

As for the original question, I don't notice any immediate problems with the
code:

  in page1.php:

  ? session_start();
  $_SESSION[var] = Please help; ?
  form action=sessionTest2.php method=post
  input type=text name=loopCount size=21,
  maxlength=20/td 
  input type=submit value=Submit/td   

  in page2.php:

  ? session_start();
  echo $_SESSION[var];
  echo $_POST[loopCount];
  ?

You mentioned seeing Please help in a cookie. Are you certain about this? I
don't understand how that can end up in a cookie unless you set the cookie
yourself or there is a serious bug.

Aside from that, it is also worth analyzing exactly what cookies are getting
sent by the browser when it requets page2.php. Can you show us the HTTP for
this particular transaction?

Chris

=
My Blog
 http://shiflett.org/
HTTP Developer's Handbook
 http://httphandbook.org/
RAMP Training Courses
 http://www.nyphp.org/ramp

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



RE: [PHP] PHP not remembering sessions

2003-10-23 Thread Golawala, Moiz M (IndSys, GE Interlogix)
Hi Warren,

Ahh.. now i know what you mean by save handler routines.. I don't have any in any of 
my php files.

yes, the save_path was pointing to the place where I have the web files stored. I can 
see the session files in that directory. I have tried to point to another directory 
too. But I have the same problem. Each time I do a session start on a page, I have a 
new session file. The first one has data in it because I add the data to the session 
on the page. The second session file is empty. Infact if I have an ?echo SID;? on 
each of the 2 pages, I see different session Ids.

You are correct.. I didn't think about a user getting to the session files. modify the 
php.ini file to save the session files to a more secure location.  

 Regards,
 Moiz Golawala
 Casi-Rusco, a GE Interlogix Company
 791 Park Of Commerce Blvd., Boca Raton, FL 33487 *
 [EMAIL PROTECTED] *
 561-912-5972 *  561-912-1650 *
 


-Original Message-
From: Vail, Warren [mailto:[EMAIL PROTECTED]
Sent: Thursday, October 23, 2003 4:42 PM
To: Golawala, Moiz M (IndSys, GE Interlogix); Curt Zirzow;
[EMAIL PROTECTED]
Subject: RE: [PHP] PHP not remembering sessions


while this doesn't mean that save handler routines are not used, it provides
some clues.

Does the directory pointed to by the session.save_path contain session files
(they will usually have an encrypted filename)?

save handler routines are actually defined in your php files, usually
dynamically, possibly in a common include file; and they override but do not
change the settings in your php.ini file.

http://us4.php.net/manual/en/function.session-set-save-handler.php

The directory pointed to, looks suspicious since it appears that it may be
in the web space area (accessible to http:), if someone can browse that
directory with a browser, all kinds of good things might be found inside
sessions???  if your http.conf file (for apache) points to something other
than htdocs as the web root, you may be ok.

Warren

-Original Message-
From: Golawala, Moiz M (IndSys, GE Interlogix)
[mailto:[EMAIL PROTECTED]
Sent: Thursday, October 23, 2003 1:31 PM
To: Vail, Warren; Curt Zirzow; [EMAIL PROTECTED]
Subject: RE: [PHP] PHP not remembering sessions


This is what is defined in the php.ini file for save handler routines.. I am
newbie, I left it with default values:

session.save_handler = files
session.save_path = c:/Program Files/Apache Group/Apache2/htdocs/Alarms/

thanks
moiz


-Original Message-
From: Vail, Warren [mailto:[EMAIL PROTECTED]
Sent: Thursday, October 23, 2003 4:27 PM
To: 'Curt Zirzow'; [EMAIL PROTECTED]
Subject: RE: [PHP] PHP not remembering sessions


are you using session save handler routines?

If not make sure you have a /tmp directory on your server, in fact you can
check phpinfo() to find out what the session save directory is (provided you
are not using save handler routines).

good luck

Warren Vail

-Original Message-
From: Curt Zirzow [mailto:[EMAIL PROTECTED]
Sent: Thursday, October 23, 2003 1:30 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] PHP not remembering sessions


* Thus wrote Daniel Guerrier ([EMAIL PROTECTED]):
 Use
 $_SESSION['var']
 
 instead of
 
 $_SESSION[var]

This doesn't matter.


Curt
-- 
My PHP key is worn out

  PHP List stats since 1997: 
  http://zirzow.dyndns.org/html/mlists/

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

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

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

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



RE: [PHP] PHP not remembering sessions

2003-10-23 Thread Golawala, Moiz M (IndSys, GE Interlogix)
Chris,

I am sorry to call it a cookie.. I see the data in a session file (not a cookie) I 
don't have a html file. I simply call the .php file by typing the url as 
http://localhost/page1.php

Thanks
moiz


-Original Message-
From: Chris Shiflett [mailto:[EMAIL PROTECTED]
Sent: Thursday, October 23, 2003 4:49 PM
To: Daniel Guerrier; Golawala, Moiz M (IndSys, GE Interlogix);
[EMAIL PROTECTED]
Subject: Re: [PHP] PHP not remembering sessions


--- Daniel Guerrier [EMAIL PROTECTED] wrote:
 Use
 $_SESSION['var']
 
 instead of
 
 $_SESSION[var]

That won't make any difference.

As for the original question, I don't notice any immediate problems with the
code:

  in page1.php:

  ? session_start();
  $_SESSION[var] = Please help; ?
  form action=sessionTest2.php method=post
  input type=text name=loopCount size=21,
  maxlength=20/td 
  input type=submit value=Submit/td   

  in page2.php:

  ? session_start();
  echo $_SESSION[var];
  echo $_POST[loopCount];
  ?

You mentioned seeing Please help in a cookie. Are you certain about this? I
don't understand how that can end up in a cookie unless you set the cookie
yourself or there is a serious bug.

Aside from that, it is also worth analyzing exactly what cookies are getting
sent by the browser when it requets page2.php. Can you show us the HTTP for
this particular transaction?

Chris

=
My Blog
 http://shiflett.org/
HTTP Developer's Handbook
 http://httphandbook.org/
RAMP Training Courses
 http://www.nyphp.org/ramp

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

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



RE: [PHP] PHP not remembering sessions

2003-10-23 Thread Chris Shiflett
--- Golawala, Moiz M (IndSys, GE Interlogix) [EMAIL PROTECTED] wrote:
 I am sorry to call it a cookie.. I see the data in a session file
 (not a cookie)

OK, so you just look in this file manually?

 I don't have a html file. I simply call the .php file by typing the
 url as http://localhost/page1.php

HTML and HTTP are two different things. What I wanted to find out is whether
your browser is sending the cookie when it requests that second page. Put this
code in there:

pThe cookie data is:
pre[? print_r($_POST); ?]/pre

Let us know what that shows.

Chris

=
My Blog
 http://shiflett.org/
HTTP Developer's Handbook
 http://httphandbook.org/
RAMP Training Courses
 http://www.nyphp.org/ramp

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



RE: [PHP] PHP not remembering sessions

2003-10-23 Thread Vail, Warren
Sounds to me like the browser you are using has cookies disabled?

Curious, do you see a parameter in your php.ini labeled session.name?

In fact, why don't you compare your setup to the following from a foxserv
installation of sessions;

Directive  Local Value Master Value 
session.auto_start OffOff 
session.cache_expire 180
180 
session.cache_limiternocache  nocache 
session.cookie_domain   no value no
value 
session.cookie_lifetime   00

session.cookie_path   //

session.cookie_secure  OffOff 
session.entropy_file no value  no value 
session.entropy_length  0 0 
session.gc_maxlifetime  14401440

session.gc_probability1   1 
session.namePHPSESSID   PHPSESSID 
session.referer_checkno valueno value 
session.save_handler  files   files 
session.save_path   C:\FoxServ\sessiondata
C:\FoxServ\sessiondata 
session.serialize_handlerphp php

session.use_cookies   On  On

session.use_trans_sid   1 1 

I have had people (who didn't know what they were doing) change values like
cookie_lifetime and cause sessions to look like they had timed out after the
cookie was distroyed by the browser.

hope this gets you back and running.

Warren


-Original Message-
From: Golawala, Moiz M (IndSys, GE Interlogix)
[mailto:[EMAIL PROTECTED]
Sent: Thursday, October 23, 2003 1:49 PM
To: Vail, Warren; Curt Zirzow; [EMAIL PROTECTED]
Subject: RE: [PHP] PHP not remembering sessions


Hi Warren,

Ahh.. now i know what you mean by save handler routines.. I don't have any
in any of my php files.

yes, the save_path was pointing to the place where I have the web files
stored. I can see the session files in that directory. I have tried to point
to another directory too. But I have the same problem. Each time I do a
session start on a page, I have a new session file. The first one has data
in it because I add the data to the session on the page. The second session
file is empty. Infact if I have an ?echo SID;? on each of the 2 pages, I
see different session Ids.

You are correct.. I didn't think about a user getting to the session files.
modify the php.ini file to save the session files to a more secure location.


 Regards,
 Moiz Golawala
 Casi-Rusco, a GE Interlogix Company
 791 Park Of Commerce Blvd., Boca Raton, FL 33487 *
 [EMAIL PROTECTED] *
 561-912-5972 *  561-912-1650 *
 


-Original Message-
From: Vail, Warren [mailto:[EMAIL PROTECTED]
Sent: Thursday, October 23, 2003 4:42 PM
To: Golawala, Moiz M (IndSys, GE Interlogix); Curt Zirzow;
[EMAIL PROTECTED]
Subject: RE: [PHP] PHP not remembering sessions


while this doesn't mean that save handler routines are not used, it provides
some clues.

Does the directory pointed to by the session.save_path contain session files
(they will usually have an encrypted filename)?

save handler routines are actually defined in your php files, usually
dynamically, possibly in a common include file; and they override but do not
change the settings in your php.ini file.

http://us4.php.net/manual/en/function.session-set-save-handler.php

The directory pointed to, looks suspicious since it appears that it may be
in the web space area (accessible to http:), if someone can browse that
directory with a browser, all kinds of good things might be found inside
sessions???  if your http.conf file (for apache) points to something other
than htdocs as the web root, you may be ok.

Warren

-Original Message-
From: Golawala, Moiz M (IndSys, GE Interlogix)
[mailto:[EMAIL PROTECTED]
Sent: Thursday, October 23, 2003 1:31 PM
To: Vail, Warren; Curt Zirzow; [EMAIL PROTECTED]
Subject: RE: [PHP] PHP not remembering sessions


This is what is defined in the php.ini file for save handler routines.. I am
newbie, I left it with default values:

session.save_handler = files
session.save_path = c:/Program Files/Apache Group/Apache2/htdocs/Alarms/

thanks
moiz


-Original Message-
From: Vail, Warren [mailto:[EMAIL PROTECTED]
Sent: Thursday, October 23, 2003 4:27 PM
To: 'Curt Zirzow'; [EMAIL PROTECTED]
Subject: RE: [PHP] PHP not remembering sessions


are you using session save handler routines?

If not make sure you have a /tmp directory on your server, in fact you can
check phpinfo() to find out what the session save directory is (provided you
are not using save handler routines).

good luck

Warren

RE: [PHP] PHP not remembering sessions

2003-10-23 Thread Golawala, Moiz M (IndSys, GE Interlogix)
I added the code you mentioned. Below is the result from the browser. I notice that 
the sessionId is the correct one from the previous page.
I think this is good new.. :)

2
[Array
(
[PHPSESSID] = 0572d98f00483accdc6e61348b359287
[loopCount] = 2
)
]

Thanks
moiz


-Original Message-
From: Chris Shiflett [mailto:[EMAIL PROTECTED]
Sent: Thursday, October 23, 2003 5:03 PM
To: Golawala, Moiz M (IndSys, GE Interlogix); Daniel Guerrier;
[EMAIL PROTECTED]
Subject: RE: [PHP] PHP not remembering sessions


--- Golawala, Moiz M (IndSys, GE Interlogix) [EMAIL PROTECTED] wrote:
 I am sorry to call it a cookie.. I see the data in a session file
 (not a cookie)

OK, so you just look in this file manually?

 I don't have a html file. I simply call the .php file by typing the
 url as http://localhost/page1.php

HTML and HTTP are two different things. What I wanted to find out is whether
your browser is sending the cookie when it requests that second page. Put this
code in there:

pThe cookie data is:
pre[? print_r($_POST); ?]/pre

Let us know what that shows.

Chris

=
My Blog
 http://shiflett.org/
HTTP Developer's Handbook
 http://httphandbook.org/
RAMP Training Courses
 http://www.nyphp.org/ramp

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