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

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue May 06 06:01:29 2025 UTC