note 109811 rejected from function.session-id by aharvey
| From: | aharvey@php.net | Date: | Fri, 24 Aug 2012 01:19:53 +0000 |
| Subject: | note 109811 rejected from function.session-id by aharvey | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-190201@lists.php.net to get a copy of this message | ||
Note Submitter: Michele Bonera
----
I use a flash uploader that doesn't inherits cookies from the current session, so I have to
force the session by passing the PHPSESSID in get.
The PHP file that received the file, uses session_id($received_session_id) to set the ID, but if I
don't force a session_start(), I don't inherit values in $_SESSION supervar.
<?php
// Get session ID from GET
if (isset($_REQUEST['phpsessid'])) {
// Start session with passed ID
session_id($_REQUEST['phpsessid']);
@session_start();
} else {
die('ERROR:NO_SESSION');
}
?>