php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #13834 SID already defined
Submitted: 2001-10-26 01:30 UTC Modified: 2002-09-25 06:38 UTC
Votes:2
Avg. Score:4.0 ± 1.0
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:0 (0.0%)
From: shelby at DownloadFAST dot com Assigned:
Status: Closed Package: Session related
PHP Version: 4.1.2 OS: FreeBSD 4.2
Private report: No CVE-ID: None
 [2001-10-26 01:30 UTC] shelby at DownloadFAST dot com
This is intended as more information for Bug id #11643.  I could not make comments directly as I am not the creator of the bug and I don't have Dev Edit privilegdes either.

In any case, the redefinition is apparently session_start().  If I do more than one session_start(), separated by a session_destroy(), then I get warning:

Warning: Constant sid already defined in /usr/home/smoore/php-include/Session_class.php on line 80

I am sure it is session_start() because the following makes the warning go away:


$save = error_reporting( E_ERROR ); // temporarily turn off warnings
session_start();
error_reporting( $save );


Obviously the fix is to undefine SID in session_destroy.  However, there is no undefine in PHP is there?

It must be redefined because the original session has been destroyed and the new one has a new session_id().

This doesn't bother my code because I don't use SID.

Hope this helps...

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-12-19 22:53 UTC] yohgaki@php.net
Please test with 4.1.0 and latest CVS snapshot.
CVS snapshot source can be found 
http://snaps.php.net/
(No windows binary)

If you don't have problem with latest CVS snapshot,
you can close your bug report by yourself.

Please report the result. When you update your bug
report, do not forget updating PHP version also.

Thank you
-- 
Yasuo


 [2002-01-09 02:09 UTC] lobbin@php.net
No feedback. Closing.
 [2002-03-10 15:53 UTC] mike at msbnetworks dot net
This is still broken in 4.1.2

Using Horde 2.0 & IMP 3.0 wiht an SQL session handler, we get the following error:

[Sun Mar 10 15:16:29 2002] [error] PHP Warning:  Constant sid already defined in /home/secure/public_html/horde/lib/Prefs.php on line 91
[Sun Mar 10 15:16:29 2002] [error] PHP Fatal error:  Failed to initialize session module in /home/secure/public_html/horde/lib/Prefs.php on line 91

The code causing the error is the usual destory/start:

        if ($registry->getMethod('auth/logout') == $registry->getApp()) {
            include_once HORDE_BASE . '/lib/Auth.php';
            Auth::clearAuth();
            session_destroy();
            @session_start();
        }

Execution stops immediately after the session_start or better put inside session_start as no debug msg immediately after the session_start is ever printed.
 [2002-03-11 07:46 UTC] sander@php.net
Reopening and updating reporter & version.
 [2002-09-25 06:38 UTC] sas@php.net
Same as #11643. Ilia is working on it.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 19:01:29 2024 UTC