|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #17441 session register
Submitted: 2002-05-26 16:40 UTC Modified: 2002-05-30 17:58 UTC
Avg. Score:5.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:2 (100.0%)
From: jrg89 at hotmail dot com Assigned:
Status: Not a bug Package: Session related
PHP Version: 4.2.1 OS: windows
Private report: No CVE-ID: None
 [2002-05-26 16:40 UTC] jrg89 at hotmail dot com
I've been scratching my head over this for sometime now.
I'm sure I'm doing something wrong and hope someone can help. The problem is simple: 

if (isset($HTTP_SESSION_VARS['count']))
	print "NOT registered:";


Hello visitor, you have seen this page <?php echo $HTTP_SESSION_VARS['count'] ?> times.<p>

To continue, <A HREF="http://localhost/jobs4us/main.php?<?php echo SID?>">click here</A>

-- The above code is available on the  php site.
Problem:every time I reload the above page, or link to it from another page, $HTTP_SESSION_VARS['count'] always shows 0. Why? I can see the session is saved in my temp file (size 1K), but when i reload the page, why does the code 'think' that the session is not registered? Of course, I tried session_is registered("count") but to no avail. Any help would be appreciated. 


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2002-05-26 17:23 UTC] jrg89 at hotmail dot com
oops - left out session_register("count"); so the code looks like this:

if (isset($HTTP_SESSION_VARS['count'])) {
else {
	print "NOT registered session:";


Hello visitor, you have seen this page <?php echo $HTTP_SESSION_VARS['count'] ?> times.<p>

To continue, <A HREF="http://localhost/index.php?<?php echo SID?>">click here</A>
 [2002-05-30 15:55 UTC] n dot ponsich at netcourrier dot com
Y have the same trouble with win XP and easyPHP 1.6 even if i upgarde
PHP to 4.2.1
 [2002-05-30 16:33 UTC] n dot ponsich at netcourrier dot com
mytrouble is resolved in the 4.2.2dev
 [2002-05-30 17:58 UTC]

"For each name, session_register() registers the global variable with that name in the current session."

and further

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

PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Tue Dec 05 10:01:26 2023 UTC