From:             raml at hotmail dot com
Operating system: Windows XP
PHP version:      5.0.3
PHP Bug Type:     Session related
Bug description:  $_SESSION and session.auto_start do not store values

Description:
------------
I am using PHP 5 and I ran into a problem using $_SESSION and
session_start() because they do not store values.  I have the
register_globals option set to Off and the session.auto_start set to 0. I
am running apache 2.0 on my computer as a test server through localhost.
It has also caused me trouble when I am trying to use User Authentication
Applications


Reproduce code:
---------------
page1.php-------------------------------------------------------

// This first page is suppoused to store "Hello world!" as a value in the 
$_SESSION['sess_var'] so it can pass it to page2.php

<?php
  session_start();
  
  $_SESSION['sess_var'] = "Hello world!";

  echo 'The content of $_SESSION[\'sess_var\'] is '
        .$_SESSION['sess_var'].'<br />';
?>
<a href="page2.php">Next page</a> 

page2.php-------------------------------------------------------

// Somehow it does not display "Hello World!"

<?php
  session_start();

  echo 'The content of $_SESSION[\'sess_var\'] is '
        .$_SESSION['sess_var'].'<br />';

  unset($_SESSION['sess_var']);
?>
<a href="page3.php">Next page</a>

page3.php-------------------------------------------------------

<?php
 
  session_start();

  echo 'The content of $_SESSION[\'sess_var\'] is '
        .$_SESSION['sess_var'].'<br />';

  session_destroy();
?> 

Expected result:
----------------
I would expect page1.php and page2.php to show:

The content of $_SESSION['sess_var'] is Hello world!
Next page 

But page2.php only shows:

The content of $_SESSION['sess_var'] is
Next page 

Actual result:
--------------
Page1.php:

The content of $_SESSION['sess_var'] is Hello world!
Next page 

Page2.php only shows:

The content of $_SESSION['sess_var'] is
Next page 

-- 
Edit bug report at http://bugs.php.net/?id=32628&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=32628&r=trysnapshot4
Try a CVS snapshot (php5.0): 
http://bugs.php.net/fix.php?id=32628&r=trysnapshot50
Try a CVS snapshot (php5.1): 
http://bugs.php.net/fix.php?id=32628&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=32628&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=32628&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=32628&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=32628&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=32628&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=32628&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=32628&r=notwrong
Not enough info:             
http://bugs.php.net/fix.php?id=32628&r=notenoughinfo
Submitted twice:             
http://bugs.php.net/fix.php?id=32628&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=32628&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=32628&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=32628&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=32628&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=32628&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=32628&r=float
No Zend Extensions:          http://bugs.php.net/fix.php?id=32628&r=nozend
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=32628&r=mysqlcfg

Reply via email to