Re: [PHP] Sessions simply do not work?

2004-05-25 Thread Michael R. Wayne
On Tue, May 25, 2004 at 07:37:47AM +0100, Peter Risdon wrote:
 Michael R. Wayne wrote:
 
 In my continuing efforts to actually get sessions to work, I upgraded
 to PHP 4.3.6 and apache 1.3.31.  This did not make the slighest
 difference.
 
 So, does ANYone have ideas of how to debug this?  Or is PHP simply
 broken and no longer able to maintain sessions?  
 
 I've just been debugging some session problems. Successfully, but there 
 is something rather brittle in there somewhere 

It seems that people have forgotten last week's postings.  To recap:

Session support worked fine in 4.1.2.  It's broken in 4.3.4 and 4.3.6.

The relevant session variables are:
   Session Support  enabled  (as per phpinfo)
   session.auto_start   On or Off (makes no difference)
   session.use_cookies  Off - not using cookies
   session.name PHPSESSID
   session.use_trans_sidOff (trans_sid worked with forms in 4.1.2)
   session.gc_maxlifetime   1440
Other things people have asked about:
   url_rewriter.tagsa=href,area=href,frame=src,input=src,form=fakeentry

Environment
   FreeBSD 4.8, Apache/1.3.31 (Unix) PHP/4.3.6 mod_ssl/2.8.17 OpenSSL/0.9.7d 

The session directory is writable and the files are getting properly
written to that directory as shown below.

I invoke the script from a browser and see the following:
   Stage:0 SessionID: 509012dd5633cba355c270f3934d1201   
   ___ [Submit]
   Stage:1 SessionID: 509012dd5633cba355c270f3934d1201
   Request: Array ( ) 
   GET: Array ( ) POST: Array ( [field] = ) COOKIE: Array ( ) 

Checking the session directory, I see an appropriately named file:
   -rw---  1 nobody  msen  10 May 25 12:00 sess_509012dd5633cba355c270f3934d1201
containing
   stage|i:1;
The Apache log contains two lines.  The first does not contain the 
browser version and the second one does:
   GET /g/xxx.php HTTP/1.0
   GET /g/xxx.php HTTP/1.0 200 476 - Mozilla/4.0 (compatible; MSIE 6.0; MSIE 5.5; 
Windows 98) Opera 7.02  [en]

So I enter foo in the form and hit Submit.  The browser screen shows
that the script failed to use the session variable, but it remembers
it:
   Stage:0 SessionID: d7002911afdc01a5218e06af2b8f02ad   
   foo [Submit]
   Stage:1 SessionID: d7002911afdc01a5218e06af2b8f02ad
   Request: Array ( [PHPSESSID] = 509012dd5633cba355c270f3934d1201 [field] = foo ) 
   GET: Array ( [PHPSESSID] = 509012dd5633cba355c270f3934d1201 ) POST: Array ( 
[field] = foo ) COOKIE: Array ( ) 
The session directory now contains TWO files:
   -rw---  1 nobody  msen  10 May 25 12:00 sess_509012dd5633cba355c270f3934d1201
   -rw---  1 nobody  msen  10 May 25 12:03 sess_d7002911afdc01a5218e06af2b8f02ad
each containing:
   stage|i:1;
and the Apache log once again has two lines.  The browser has passed back
the original session ID but PHP has ignored it and assigned a new one.
   POST /g/xxx.php?PHPSESSID=509012dd5633cba355c270f3934d1201 HTTP/1.0 200 605
   POST /g/xxx.php?PHPSESSID=509012dd5633cba355c270f3934d1201 HTTP/1.0 200 605 
http://SERVER/xxx.php; Mozilla/4.0 (compatible; MSIE 5.0; Windows 2000) Opera 6.05  
[en]

Now, I hit Submit once more and PHP does manage to re-use the session!  And it
will continue to do so until the script is re-invoked by another browser:
   Stage:1 SessionID: d7002911afdc01a5218e06af2b8f02ad   
   foo [Submit]
   Stage:1 SessionID: d7002911afdc01a5218e06af2b8f02ad
   Request: Array ( [PHPSESSID] = d7002911afdc01a5218e06af2b8f02ad [field] = foo ) 
   GET: Array ( [PHPSESSID] = d7002911afdc01a5218e06af2b8f02ad ) POST: Array ( 
[field] = foo ) COOKIE: Array ( ) 
the session directory remains unchanged other than access time on the
reused session:
   -rw---  1 nobody  msen  10 May 25 12:00 sess_509012dd5633cba355c270f3934d1201
   -rw---  1 nobody  msen  10 May 25 12:13 sess_d7002911afdc01a5218e06af2b8f02ad
each containing:
   stage|i:1;
The Apache log once again contains two lines:
   POST /g/xxx.php?PHPSESSID=d7002911afdc01a5218e06af2b8f02ad HTTP/1.0 200 605
   POST /g/xxx.php?PHPSESSID=d7002911afdc01a5218e06af2b8f02ad HTTP/1.0 200 605 
http://SERVER/xxx.php?PHPSESSID=509012dd5633cba355c270f3934d1201; Mozilla/4.0 
(compatible; MSIE 5.0; Windows 2000) Opera 6.05  [en]

And, finally, here is the test script.   Install it as xxx.php if you want to test it:

?
   if (!session_id()) session_start();
   if (!isset($_SESSION['stage'])) $_SESSION['stage'] = 0;
   if (!isset($_POST['field']))  $_POST['field'] = ; 
?
htmlheadtitlePHP Test page/title/headbody
?
   echo Stage:; echo $_SESSION['stage'];
   echo  SessionID: ; echo session_id();
   $_SESSION['stage'] = 1;
?
   form method=post action=xxx.php??= SID; ?
  input type=text maxlength=7 size=7 name=field value=?echo 
$_POST['field']?
  input type=submit value=Submit
   /form
?
   echo Stage:; echo $_SESSION['stage']; echo  ;
   echo  SessionID: ; echo session_id(); echo br;
   echo  Request: ; print_r($_REQUEST);
   echo brGET: ; print_r

Re: [PHP] Sessions simply do not work?

2004-05-25 Thread Michael R. Wayne

Sessions do not work properly for me.  Thanks to other people on
this list, we've proven that the test script I am using works fine
for other people.  So, something is wrong with PHP on all of my
systems since the same script fails (see previous posts) on multiple
servers for me.

So, I am now seeking information on how to debug PHP (not my
script but PHP itself) to determine where the failure lies.

Help??

/\/\ \/\/

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



[PHP] Sessions simply do not work?

2004-05-24 Thread Michael R. Wayne
In my continuing efforts to actually get sessions to work, I upgraded
to PHP 4.3.6 and apache 1.3.31.  This did not make the slighest
difference.

So, does ANYone have ideas of how to debug this?  Or is PHP simply
broken and no longer able to maintain sessions?  

/\/\ \/\/

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



Re: [PHP] Re: sessions

2004-05-24 Thread Michael R. Wayne
On Sun, May 23, 2004 at 09:00:41PM +0200, Maarten Weyn wrote:
 It worked for 5 minutes after a reboot, but now i get the same problem
 
 what happens is that on every session_start();
 a new sessid is created how comes it doesn't use the old one

I am starting to believe that session support is badly broken in PHP.
I've been trying to solve a similar situation (sessions never work
for me, even after an apache restart) and the list seems baffled.

/\/\ \/\/

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



[PHP] Sessions still do not persist

2004-05-21 Thread Michael R. Wayne

I've posted several times mentioning that I am completely unable
to cause sessions to persist.  Over the intervening time, I have
replicated this problem to a different machine, with the same
results.  Here's a recap of the problem.

I am not using cookies.  Sessions are automatically created (and
changing that makes no difference)  The relevant session variables
(copied from phpinfo) are:
   Session Support  enabled
   session.auto_start   On  - hence no session_start 
   session.name PHPSESSID
   session.use_cookies  Off - no cookies
   session.use_trans_sidOn

Environment is FreeBSD4.8.  phpinfo for apache says:
   Apache/1.3.29 (Unix) mod_perl/1.28 PHP/4.3.4 mod_ssl/2.8.16 OpenSSL/0.9.6d 


Here is a cut/paste of the borwser screen for the code below:

   Stage:0 SessionID: 04ace04b1fe0bc81d2cd678c9bab1619 
   _ [Submit]
   Stage:1 SessionID: 04ace04b1fe0bc81d2cd678c9bab1619 Request: Array ( ) 

So I type foo into the box and hit submit.  And the session variable
is NOT preserved:

   Stage:0 SessionID: 55c70989b7279d6a18edfd81b28d67a6 
   foo___ [Submit]
   Stage:1 SessionID: 55c70989b7279d6a18edfd81b28d67a6 Request: Array ( [PHPSESSID] = 
04ace04b1fe0bc81d2cd678c9bab1619 [field] = foo ) 

The session directory IS writable and I see the expected information
being written there:
   -rw---  1 nobody   wheel  10 May 21 13:35 
sess_04ace04b1fe0bc81d2cd678c9bab1619
   -rw---  1 nobody   wheel  10 May 21 13:38 
sess_55c70989b7279d6a18edfd81b28d67a6

Apache runs as user nobody on this server.  Both session files contain:
   stage|i:1;
but the files never seem to be being read back!

Help!?


Here's the entire php code I'm testing with:

?
if (!isset($_SESSION['stage'])) {
   $_SESSION['stage'] = 0;
   }
if (!isset($_POST['field'])) { $_POST['field'] = ; }
?
html 
headtitlePHP Test page/title/head
body
?
  echo Stage:; echo $_SESSION['stage'];
  echo  SessionID: ; echo session_id();
  $_SESSION['stage'] = 1;
?
   form method=post action=xxx.php
  input type=text maxlength=7 size=7 name=field value=?echo 
$_POST['field']?
  input type=submit value=Submit
   /form
?
  echo Stage:; echo $_SESSION['stage']; echo  ;
  echo  SessionID: ; echo session_id(); echo  ;
  echo  Request: ; print_r($_REQUEST);
?
/body /html

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



Re: [PHP] Re: Sessions still do not persist

2004-05-21 Thread Michael R. Wayne
On Fri, May 21, 2004 at 08:04:00PM +0200, Torsten Roehr wrote:
 
 As far as I remember session.use_trans_sid does NOT work with forms (action
 attribute). Have you tried appending it manually to the action?:

Well, this certainly seems to be progress in the correct direction.
So session.use_trans_sid used to work with forms in 4.1.2 (I'm
suffering from an upgrade here) but no longer does?  This really
helps.

 form method=post action=xxx.php?= SID; ?

This ALMOST works.  Looks like a seperator is needed.  I get:
   POST /xxx.phpPHPSESSID=3a2c0413ec84a00e36ea0317c193ccb2 HTTP/1.1

Do I want ?=PHPSESSID=sessionID or just ?=sessionID or what?

Thanx!

/\/\ \/\/

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



Re: [PHP] Re: Sessions still do not persist

2004-05-21 Thread Michael R. Wayne
On Fri, May 21, 2004 at 08:35:37PM +0200, Torsten Roehr wrote:
 
 Sorry, I'm an idiot! The ? was missing:
 
 form method=post action=xxx.php??= SID; ?

Thank you, thank you.  This does indeed seem to work in my test script.
Now to go work on the real version.

 This should work. As far as I have seen trans_sid is not used very often -
 obviously because of problems like yours. The best way is always to pass the
 session ID yourself. Either with a cookie or via GET. I prefer GET because
 with cookies you are reliant on the client supporting/allowing cookies.

Oddly, this all worked properly under 4.1.2.  When we upgraded,
things broke.  And I have a strong personal bias against cookies.

One again, thank you for the solution!

/\/\ \/\/

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



Re: [PHP] Re: Sessions still do not persist

2004-05-21 Thread Michael R. Wayne
On Fri, May 21, 2004 at 08:35:37PM +0200, Torsten Roehr wrote:
 Sorry, I'm an idiot! The ? was missing:
 
 form method=post action=xxx.php??= SID; ?
 

Well, I spoke too soon.  It does work, but only the SECOND time the 
script is run!

   Stage:0 SessionID: 6c9a1819fe95fa6f08f385ee2afa71ca 
   __ [Submit]
   Stage:1 SessionID: 6c9a1819fe95fa6f08f385ee2afa71ca Request: Array ( ) 
Type foo into the form, hit submit and the session variable is not being
preserved:
   Stage:0 SessionID: ac429ad0086eb5b4d1130eb2e2fddcb9 
   foo___ [Submit]
   Stage:1 SessionID: ac429ad0086eb5b4d1130eb2e2fddcb9 Request: Array ( [PHPSESSID] = 
6c9a1819fe95fa6f08f385ee2afa71ca [field] = foo ) 
Type bar into the form, hit submit and the session variable
IS being preserved:
   Stage:1 SessionID: ac429ad0086eb5b4d1130eb2e2fddcb9 
   bar___ [Submit]
   Stage:1 SessionID: ac429ad0086eb5b4d1130eb2e2fddcb9 Request: Array ( [PHPSESSID] = 
ac429ad0086eb5b4d1130eb2e2fddcb9 [field] = bar ) 

So, what am I missing here?


Code, for reference:
?
if (!isset($_SESSION['stage'])) {
   $_SESSION['stage'] = 0;
   }
if (!isset($_POST['field'])) { $_POST['field'] = ; }
?
html
headtitlePHP Test page/title/head
body
?
  echo Stage:; echo $_SESSION['stage'];
  echo  SessionID: ; echo session_id();
  $_SESSION['stage'] = 1;
?
   form method=post action=xxx.php??= SID; ?
  input type=text maxlength=7 size=7 name=field value=?echo 
$_POST['field']?
  input type=submit value=Submit
   /form
?
  echo Stage:; echo $_SESSION['stage']; echo  ;
  echo  SessionID: ; echo session_id(); echo  ;
  echo  Request: ; print_r($_REQUEST);
?
/body /html

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



Re: [PHP] Re: Sessions still do not persist

2004-05-21 Thread Michael R. Wayne
On Fri, May 21, 2004 at 09:12:02PM +0200, Torsten Roehr wrote:
 
  So, what am I missing here?
 
 You could try it without session.auto_start. Turn it off and put
 session_start() at the top of the script (in all pages).

Tried that - makes no difference.  Still works properly on the second
call but not the first.

/\/\ \/\/

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



Re: [PHP] Sessions still do not persist

2004-05-21 Thread Michael R. Wayne
On Fri, May 21, 2004 at 11:02:49AM -0700, Daniel Clark wrote:
 Try a session_start() at the top of pages, see if that works.
 Maybe the auto_start does not work.

Done:
   session.auto_start = 0
added session_start to script.  No change in behaviour.

/\/\ \/\/

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



Re: [PHP] session_start in php 4.3.6

2004-05-21 Thread Michael R. Wayne
On Fri, May 21, 2004 at 10:01:56PM +0200, Paul Godard wrote:
 Hi
 
 All my web sites suddenly stopped working after my ISP installed the newer php 4.3.6 
 released.  The problem is when calling the session_start() function.  It seems that 
 the warning message saying that the session has already started and that the 
 function will be ignored makes the php script stop at this point although it is a 
 warning.  This worked perfectly in php 4.3.4.
 
 What should I do to be compatible with php 4.3.6?

This is because your ISP has likely set 
   session.auto_start = 1
in php.ini

Either have the ISP set it to 0 or remove all session_start calls
from your scripts to eliminate the warnings.

/\/\ \/\/

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



Re: [PHP] Sessions still do not persist

2004-05-21 Thread Michael R. Wayne
On Fri, May 21, 2004 at 08:41:00PM +, Curt Zirzow wrote:
 * Thus wrote Michael R. Wayne ([EMAIL PROTECTED]):
  
  I've posted several times mentioning that I am completely unable
  to cause sessions to persist.  Over the intervening time, I have
  replicated this problem to a different machine, with the same
  results.  Here's a recap of the problem.
  
  I am not using cookies.  Sessions are automatically created (and
  changing that makes no difference)  The relevant session variables
  (copied from phpinfo) are:
 Session Support  enabled
 session.auto_start   On  - hence no session_start 
 session.name PHPSESSID
 session.use_cookies  Off - no cookies
 session.use_trans_sidOn
 
 url_rewriter.tags?

url_rewriter.tags  a=href,area=href,frame=src,input=src,form=fakeentry
session.use_trans_sid  Off


 It seems php isn't picking up that session that is in $_REQUEST..
 which part of request is that variable in? do this?
 
   print_r($_GET);
   print_r($_POST);
   print_r($_COOKIE);

Done - see below


 Also, is the PHPSESSID being written in the form output somewhere?
 View source of form output.

Done all 3 times


=== initial load =
Stage:0 SessionID: 86cc1b0a4dee900f85981e93bcc855b2   
Stage:1 SessionID: 86cc1b0a4dee900f85981e93bcc855b2 Request: Array ( ) 
GET: Array ( ) POST: Array ( [field] = ) COOKIE: Array ( ) 

html 
headtitlePHP Test page/title/head
body
Stage:0 SessionID: 86cc1b0a4dee900f85981e93bcc855b2   form method=post 
action=xxx.php?PHPSESSID=86cc1b0a4dee900f85981e93bcc855b2
  input type=text maxlength=7 size=7 name=field value=
  input type=submit value=Submit
   /form
Stage:1  SessionID: 86cc1b0a4dee900f85981e93bcc855b2  Request: Array
(
)
brGET: Array
(
)
 POST: Array
(
[field] = 
)
 COOKIE: Array
(
)
/body /html


= type foo, hit submit. Note differing sesison IDs =
Stage:0 SessionID: 7c6cd5d1f965de3f134442600f60565a   
Stage:1 SessionID: 7c6cd5d1f965de3f134442600f60565a Request: Array ( [PHPSESSID] = 
86cc1b0a4dee900f85981e93bcc855b2 [field] = foo ) 
GET: Array ( [PHPSESSID] = 86cc1b0a4dee900f85981e93bcc855b2 ) POST: Array ( [field] 
= foo ) COOKIE: Array ( ) 

html 
headtitlePHP Test page/title/head
body
Stage:0 SessionID: 7c6cd5d1f965de3f134442600f60565a   form method=post 
action=xxx.php?PHPSESSID=7c6cd5d1f965de3f134442600f60565a
  input type=text maxlength=7 size=7 name=field value=foo
  input type=submit value=Submit
   /form
Stage:1  SessionID: 7c6cd5d1f965de3f134442600f60565a  Request: Array
(
[PHPSESSID] = 86cc1b0a4dee900f85981e93bcc855b2
[field] = foo
)
brGET: Array
(
[PHPSESSID] = 86cc1b0a4dee900f85981e93bcc855b2
)
 POST: Array
(
[field] = foo
)
 COOKIE: Array
(
)
/body /html

= type bar, hit submit.  Note same session IDs =
Stage:1 SessionID: 7c6cd5d1f965de3f134442600f60565a   
Stage:1 SessionID: 7c6cd5d1f965de3f134442600f60565a Request: Array ( [PHPSESSID] = 
7c6cd5d1f965de3f134442600f60565a [field] = bar ) 
GET: Array ( [PHPSESSID] = 7c6cd5d1f965de3f134442600f60565a ) POST: Array ( [field] 
= bar ) COOKIE: Array ( ) 

html 
headtitlePHP Test page/title/head
body
Stage:1 SessionID: 7c6cd5d1f965de3f134442600f60565a   form method=post 
action=xxx.php?PHPSESSID=7c6cd5d1f965de3f134442600f60565a
  input type=text maxlength=7 size=7 name=field value=bar
  input type=submit value=Submit
   /form
Stage:1  SessionID: 7c6cd5d1f965de3f134442600f60565a  Request: Array
(
[PHPSESSID] = 7c6cd5d1f965de3f134442600f60565a
[field] = bar
)
brGET: Array
(
[PHPSESSID] = 7c6cd5d1f965de3f134442600f60565a
)
 POST: Array
(
[field] = bar
)
 COOKIE: Array
(
)
/body /html


php code:
?
@session_start();
if (!isset($_SESSION['stage'])) {
   $_SESSION['stage'] = 0;
   }
if (!isset($_POST['field'])) { $_POST['field'] = ; }
?
html 
headtitlePHP Test page/title/head
body
?
  echo Stage:; echo $_SESSION['stage'];
  echo  SessionID: ; echo session_id();
  $_SESSION['stage'] = 1;
?
   form method=post action=xxx.php??= SID; ?
  input type=text maxlength=7 size=7 name=field value=?echo 
$_POST['field']?
  input type=submit value=Submit
   /form
?
  echo Stage:; echo $_SESSION['stage']; echo  ;
  echo  SessionID: ; echo session_id(); echo  ;
  echo  Request: ; print_r($_REQUEST);
  echo brGET: ; print_r($_GET); echo  POST: ; print_r($_POST); echo  COOKIE: ; 
print_r($_COOKIE);

?
/body /html

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



[PHP] sessions failing to persist

2004-05-02 Thread Michael R. Wayne

As I posted last week, I seem unable to have sessions persist.  I
have ruled out https as a problem, the following simple script,
installed as xxx.php will generate a new session number every time
the field is filled in and Submit is hit.

Note that I am not using cookies, the relevant session variables are:
   Session Support  enabled
   session.auto_start   On
   session.use_cookies  Off
   session.use_trans_sidOn

When run, the session file appears to contain stage=1 but never is being
read.

I suspect I'm missing something obvious, any pointers?

/\/\ \/\/

?
if (!session_is_registered(stage)) {
   $_SESSION[stage] = 0;
   $_POST['field'] = ;
   session_register(stage);
   }
?
html headtitlePHP Test page/title/head
body
?
  echo Stage:; echo $_SESSION[stage];
  echo  SessionID: ; echo  session_id();
  $_SESSION[stage] = 1;
?
   form method=post action=xxx.php
  input type=text maxlength=7 size=7 name=field value=?echo $_POST['field']?
  input type=submit value=Submit
   /form
?
  echo Stage:; echo $_SESSION[stage];
?

/body /html

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



Re: [PHP] sessions failing to persist

2004-05-02 Thread Michael R. Wayne
On Mon, May 03, 2004 at 12:54:54AM -0400, John Nichel wrote:
 Michael R. Wayne wrote:
 
 As I posted last week, I seem unable to have sessions persist.  I
 have ruled out https as a problem, the following simple script,
 installed as xxx.php will generate a new session number every time
 the field is filled in and Submit is hit.
 
 Note that I am not using cookies, the relevant session variables are:
Session Support  enabled
session.auto_start   On
session.use_cookies  Off
session.use_trans_sidOn
 
 When run, the session file appears to contain stage=1 but never is being
 read.
 
 I suspect I'm missing something obvious, any pointers?
 
 I copy and pasted your code, and didn't get the results you described 
 above.  Basically, it all worked fine on my box (and now I have to go 
 put my ini settings back to my normal values ;)
 
 Is this a *nix or Windows machine?  Is your session directory writable 
 by the webserver user?

FreeBSD 4.8 Unix.  Yes, the session directory is writable and the
files are getting properly written to that directory - the problem
is that they are never being read (so each time I click Submit, I
get a new session ID).

/\/\ \/\/

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



Re: [PHP] sessions failing to persist

2004-05-02 Thread Michael R. Wayne
On Mon, May 03, 2004 at 06:55:25AM +0200, Richard Harb wrote:
 If the sample of code is the whole page... where do you actually start
 your session?

I am using session.auto_start, which starts it for me.  I added a
session_start while testing and it made no difference.

 session_is_registered(): mabe I'm reading the documentation wrong, but
 I interpret this function as checking whether there is the global var
 (in this case $stage) ... and since register_globals is off there
 shouldn't be such a var automatically any more.

 In the user comments there's a good example of how to handle sessions.
 
 http://www.php.net/session_is_registered#26464

OK, replaced it with the following, no change in behaviour.  I still get 
a new sessionID every time I hit Submit.

?
if (!isset($_SESSION[stage])) {
   $_SESSION[stage] = 0;
   $_POST['field'] = ;
   session_register(stage);
   }
?
html
headtitlePHP Test page/title/head
body
?
  echo Stage:; echo $_SESSION[stage];
  echo  SessionID: ; echo  session_id();
  $_SESSION[stage] = 1;
?
   form method=post action=xxx.php
  input type=text maxlength=7 size=7 name=field value=?echo $_POST['field']?
  input type=submit value=Submit
   /form
?
  echo Stage:; echo $_SESSION[stage];
?
/body /html

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



Re: [PHP] sessions failing to persist

2004-05-02 Thread Michael R. Wayne
On Mon, May 03, 2004 at 01:13:11AM -0400, John W. Holmes wrote:
 Michael R. Wayne wrote:
form method=post action=xxx.php
   input type=text maxlength=7 size=7 name=field value=?echo 
   $_POST['field']?
   input type=submit value=Submit
/form
 
 Try adding in a hidden element
 
 input type=hidden name=PHPSESSID value=?=session_id();?
 
 You're relying on PHP rewriting your forms, links, etc, to include the 
 session id, but that doesn't seem to be happening.

I pasted that line just before the /form and the behaviour remains
unchanged.  No SessionId is never showing up in the access.log

/\/\ \/\/

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



Re: [PHP] Re: https sessions failing to persist

2004-05-01 Thread Michael R. Wayne
On Fri, Apr 30, 2004 at 10:01:40PM -0500, Luis Bernardo wrote:
 
 Apache or IIS? CGI or ISAPI module?

FreeBSD4.8 
apache+mod_ssl-1.3.29+2.8.16_1
CGI

 Michael R. Wayne [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]
 
  Upgraded our PHP installation from 4.1.2 to 4.3.4, scripts that
  worked fine before are no longer doing so.  The failure can be
  traced to the fact that sessions are never being reused (i.e. a new
  session gets started with each connection).  The session files get
  written with proper information but never get read.
 
  The relevant session variables are:
 Session Support enabled
 session.auto_start On
 session.use_cookies Off
 session.use_trans_sid On
  and, as noted in the subject line, all connections are via https.
 
  Any suggestions on how to debug this?

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



[PHP] https sessions failing to persist

2004-04-30 Thread Michael R. Wayne

Upgraded our PHP installation from 4.1.2 to 4.3.4, scripts that
worked fine before are no longer doing so.  The failure can be
traced to the fact that sessions are never being reused (i.e. a new
session gets started with each connection).  The session files get
written with proper information but never get read.

The relevant session variables are:
   Session Support  enabled 
   session.auto_start   On
   session.use_cookies  Off
   session.use_trans_sidOn
and, as noted in the subject line, all connections are via https.

Any suggestions on how to debug this?

/\/\ \/\/

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



Re: [PHP] https sessions failing to persist

2004-04-30 Thread Michael R. Wayne
On Fri, Apr 30, 2004 at 08:52:37PM +, Curt Zirzow wrote:
 
 session.cookie_path
 session.cookie_domain
 session.cookie_secure

session.cookie_path /
session.cookie_secure   Off
session.cookie_domain   no value

But we never use cookies:
session.use_cookies Off

/\/\ \/\/

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