php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #69029 header function don't work correct
Submitted: 2015-02-11 13:35 UTC Modified: 2015-02-11 14:27 UTC
From: mojtaba dot khani at yahoo dot com Assigned:
Status: Not a bug Package: Unknown/Other Function
PHP Version: 5.4.37 OS: win
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: mojtaba dot khani at yahoo dot com
New email:
PHP Version: OS:

 

 [2015-02-11 13:35 UTC] mojtaba dot khani at yahoo dot com
Description:
------------
header function did not work corectly some times.

i send a example for test by your team

thanks.
mojtaba khani
mojtaba.khani@yahoo.com
+989351977673


Test script:
---------------
security.php
--------------------
session_start();
if(!isset($_SESSION["userName"])|| !isset($_SESSION["time"])||(300<=time()-$_SESSION["time"]))
{
session_destroy();
    header("location:logInUser.php");
}
require_once 'dbc.php';/// database configrator
$_SESSION["time"]=time();
mysql_query(("update users set lastActivity=".time().",online=1 where userName='".$_SESSION['userName']."'");




other page
-------------------------
require_once 'security.php'; /// 


new security.php
---------------------------
session_start();
if(isset($_SESSION["userName"])&& isset($_SESSION["time"])&&(10>time()-$_SESSION["time"]))
{
    $_SESSION["time"]=time();
    require_once 'dbc.php';
    Q("update users set lastActivity=".time().",online=1 where userName='".$_SESSION['userName']."'");
    $ad;
    $ti;
}
else 
{
    session_destroy();
    header ("location:../user/logInUser.php");
}



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-02-11 14:27 UTC] ab@php.net
-Status: Open +Status: Not a bug
 [2015-02-11 14:27 UTC] ab@php.net
Thanks for the report. For what I can see from your code, you have to exit(); after sending the location header.

Thanks.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 03 19:01:35 2025 UTC