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
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: 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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 17:01:29 2024 UTC