Bug #68650 [Sus->ReO]: Cannot set session variables in a page handling session.upload_progress

From: Date: Sun, 26 Jan 2020 01:09:26 +0000
Subject: Bug #68650 [Sus->ReO]: Cannot set session variables in a page handling session.upload_progress
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-225115@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=68650&edit=1 ID: 68650 Updated by: ramsey@php.net Reported by: Chriswright96 at hotmail dot com Summary: Cannot set session variables in a page handling session.upload_progress -Status: Suspended +Status: Re-Opened Type: Bug -Package: uploadprogress +Package: Session related Operating System: Ubuntu Trusty PHP Version: 5.5.20 Block user comment: N Private report: N New Comment: This appears to be session-related and not related to the uploadprogress extension. I'm not sure whether it's still an issue, but I'm re-opening, just in case. Previous Comments: ------------------------------------------------------------------------ [2017-10-24 09:01:59] kalle@php.net This package has not had any releases for 6 years, so I'm gonna suspend it, any new maintainer that decides to pick this up can re-open this ticket. ------------------------------------------------------------------------ [2014-12-26 15:50:50] Chriswright96 at hotmail dot com This can be solved by using: if (session_status() == PHP_SESSION_NONE) { session_start(); } Instead of: if(!isset($_SESSION)) { session_start(); } But the reasoning behind this is still not clear in documentation ------------------------------------------------------------------------ [2014-12-25 05:07:52] Chriswright96 at hotmail dot com Description: ------------ When using an upload form, with a hidden field with the session.upload_progress.name, the target page cannot set new session variables. If you use the example below (with session.upload_progress.cleanup set to off for debugging), you will notice that the 'new' session disappears when you navigate back to the first page. Test script: --------------- //test1.php <form name="fileupload" action="test2.php" method="POST" enctype="multipart/form-data"> <input type="hidden" name="<?php echo ini_get("session.upload_progress.name"); ?>" value="123"> <input type="file" name="newfile"> <input type="submit" name="submit" value="Submit"> </form> <?php if(!isset($_SESSION)) { session_start(); } print_r($_SESSION); ?> //test2.php <?php if(!isset($_SESSION)) { session_start(); } $_SESSION['new']='Im a new value that will disappear'; print_r($_SESSION); ?> <a href="test.php">Go back</a> ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=68650&edit=1

« previous php.bugs (#225115) next »