php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #13687 Session variable not set when redirecting using full URL
Submitted: 2001-10-16 06:11 UTC Modified: 2001-10-16 10:33 UTC
From: abc at dk2net dot dk Assigned:
Status: Not a bug Package: Session related
PHP Version: 4.0.6 OS: Win 98 and NT
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: abc at dk2net dot dk
New email:
PHP Version: OS:

 

 [2001-10-16 06:11 UTC] abc at dk2net dot dk
login.php checks for validity of $HTTP_POST_VARS['user'] && $HTTP_POST_VARS['pass'] and if the combination is OK sets variable $LoginSuccess which is then registered using:

session_register(LoginSuccess);

Conntrol is then transferred to next.php using the following code:

header("Location: http://$db_host/next.php"); 

The value of $db_host at this stage is "localhost".

When next.php starts executing it checks whether LoginSuccess is set like this:

session_start();
if(empty($LoginSuccess)) 
  ...... # Force new login

The problem is that the very first time the sequence above is executed, LoginSuccess evaluates to empty even though is has been set.

After a second login attemt, it usually evaluates to Set.

The problem may or may not be identical to Bug ID# 6121.

I found that the code works correctly if I use relative URL instead:

header("Location: http:next.php"); 

But really, that should'nt make a difference, should it?

I am using default configuration for session mgmt., everything is executed locally on my PC.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-10-16 10:33 UTC] sniper@php.net
Please ask support questions on the mailing lists:

http://www.php.net/support.php

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 03:01:27 2024 UTC