php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #15506 _SESSION not being created
Submitted: 2002-02-11 10:45 UTC Modified: 2002-03-05 18:32 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: vivers at one dot net Assigned:
Status: Closed Package: Session related
PHP Version: 4.1.1 OS: Linux RH7
Private report: No CVE-ID: None
 [2002-02-11 10:45 UTC] vivers at one dot net
The auto global _SESSION is not being created with session.auto_start on for my Linux Apache/PHP installation.  It works however when running on my Win98 laptop using Apache and the PHP 4.1.1 binary from php.net.

I ran this script on both platforms:

<?php
print '<pre>'; print_r(array_keys($GLOBALS)); print '</pre>';
?>

Win32 output:
Array
(
    [0] => HTTP_POST_VARS
    [1] => _POST
    [2] => HTTP_GET_VARS
    [3] => _GET
    [4] => HTTP_COOKIE_VARS
    [5] => _COOKIE
    [6] => HTTP_SERVER_VARS
    [7] => _SERVER
    [8] => HTTP_ENV_VARS
    [9] => _ENV
    [10] => HTTP_POST_FILES
    [11] => _FILES
    [12] => _REQUEST
    [13] => HTTP_SESSION_VARS
    [14] => _SESSION
    [15] => GLOBALS
)

Linux output:
Array
(
    [0] => HTTP_POST_VARS
    [1] => _POST
    [2] => HTTP_GET_VARS
    [3] => _GET
    [4] => HTTP_COOKIE_VARS
    [5] => _COOKIE
    [6] => HTTP_SERVER_VARS
    [7] => _SERVER
    [8] => HTTP_ENV_VARS
    [9] => _ENV
    [10] => HTTP_POST_FILES
    [11] => _FILES
    [12] => _REQUEST
    [13] => GLOBALS
)

I've verified that the php.ini files are identical (minus path differences).  I have register_globals Off and transparent SID enabled.

PHP 4.1.1 configuration:

./configure  --enable-trans-sid --with-apxs=/usr/local/apache/bin/apxs --with-imap --with-imap-ssl=/usr/local/ssl --with-openssl=/usr/local/ssl --with-kerberos=/usr/kerberos

Apache 1.3.23 with mod_ssl
PHP application in /usr/local/apache/zeus with appropriate VirtualHost and Directory directives in Apache httpd.conf

/usr/local/apache/zeus contains this .htaccess file

php_flag register_globals off
php_flag short_open_tag off
php_flag asp_tags off

# allow_call_time_pass_reference has been deprecated but xml_set_object requires it
php_flag allow_call_time_pass_reference on

php_flag session.use_trans_sid on
php_value session.save_handler files
php_value session.save_path /usr/local/apache/zeus/sessions
php_flag session.auto_start on
php_flag session.use_cookies off
php_value session.name ZEUSSID
php_value session.cookie_lifetime 0
php_value session.cookie_path /
php_value session.cache_limiter nocache
php_value session.serialize_handler php

php_value include_path /usr/local/apache/zeus/php/xAPP;/usr/local/apache/zeus/php

<Files app>
  Forcetype application/x-httpd-php
</Files>

I have AllowOverride set to All in the Apache conf file to allow all this to work.

I have verified the permissions on the sessions directory. The owner of the directory is the Apache user. The sessions are being created but no data is being saved in them--$_SESSION is not available.

My scripts are built on auto-start and using $_SESSION to keep things as simple as possible.

I've tried removing the .htaccess file, using the default session config (from the distribution) and using explicit session_start() at the top of the page and still $_SESSION is not created (works on Win32 though).  Added a bogus value to $_SESSION after session_start() does not work either--still 0 byte session files.  Only creates a normal PHP hash called $_SESSION.  It appears that the session module is not registering $_SESSION or $HTTP_SESSION_VARS as globals.

Thanks,

Vic Ivers

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-03-05 18:32 UTC] yohgaki@php.net
This bug has been fixed in CVS.

It's probably fixed in CVS. Please reopen if there is the problem.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 11:01:30 2024 UTC