php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #12326 Resources (like a file descriptor) don't persist correctly
Submitted: 2001-07-23 23:27 UTC Modified: 2001-07-27 13:14 UTC
From: ivans at element dot hr Assigned:
Status: Not a bug Package: Session related
PHP Version: 4.0.4 OS: Windows 2000 Server
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: ivans at element dot hr
New email:
PHP Version: OS:

 

 [2001-07-23 23:27 UTC] ivans at element dot hr
If you try session_remember()ing a variable that contains a resource, for instance one that you acquired via pfsockopen(), the value will be mangled, and the resource will become unavailable.

For instance:

<?
	session_start();
	echo gettype($socket),"<br>";
	if (!$socket) {
		$socket = fsockopen("www.php.net", 80);
		session_register("socket");
	}
	echo gettype($socket),"<br>";
?>

The second time you visit the page, the output is "integer<br>resource". It pretty much tells me that my resource gets saved as an integer, and then nobody remebers to turn it back into a resource again :(

Can this be done? Am I thinking in the wrong direction if I need file descriptor persistance?

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 15:01:30 2024 UTC