php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #19068 $_SESSION behaves like session_register(), but doesn't call session_start()
Submitted: 2002-08-23 08:10 UTC Modified: 2003-01-17 23:53 UTC
From: mfischer@php.net Assigned:
Status: Closed Package: Documentation problem
PHP Version: 4CVS-2002-08-23 OS: Any
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: mfischer@php.net
New email:
PHP Version: OS:

 

 [2002-08-23 08:10 UTC] mfischer@php.net
The manual page about session_register (http://www.php.net/manual/en/function.session-register.php) says:

"Caution: If you are using $_SESSION (or $HTTP_SESSION_VARS), do not use session_register(), session_is_registered() and session_unregister()."

and a few lines later

"If session_start() was not called before this function is called, an implicit call to session_start() with no parameters will be made."

But the latter is not true if only $_SESSION is used to register a session variable. The current implementation requires a manual call to session_start().

This should be noted there.

Idially, it should be mentioned also at http://www.php.net/manual/en/ref.session.php (where it says: Note: As of PHP 4.1.0, $_SESSION is available as global variable just like  ...) and maybe also at http://www.php.net/manual/en//language.variables.predefined.php (which may be too much good will though ;)

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-08-23 08:12 UTC] mfischer@php.net
Damn, doc problem of course.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sun Jul 06 09:01:32 2025 UTC