Ask a Question related to PHP Bugs, Design and Development.
-
jan dot morten dot sorensen at organizer dot net #1
#40615 [NEW]: session_start() kills link resource variable
From: jan dot morten dot sorensen at organizer dot net
Operating system: Win2K
PHP version: 5.2.1
PHP Bug Type: Unknown/Other Function
Bug description: session_start() kills link resource variable
Description:
------------
I have version 5.1.2. THIS MIGHT HAVE BEEN FIXED IN 5.2.1!!!
First use mysql_connect() on an included file and return the resource
identifier and store this in a variable.
Then call session_start()
Now you have lost your resource identifier!
Calling session_start() first fixes the problem.
Reproduce code:
---------------
file1.php
function connect_to_db() {
$link = mysql_connect($host, $user, $pass) or die(err_msg);
mysql_select_db($db) or die(err_msg);
return $link;
}
file2.php
include 'file1.php';
$link = connect_to_db();
echo $link;
session_start();
echo $link;
Expected result:
----------------
link resource id# ?
link resource id# ?
replace ? with a number
Actual result:
--------------
link resource id# ?
0
--
Edit bug report at [url]http://bugs.php.net/?id=40615&edit=1[/url]
--
Try a CVS snapshot (PHP 4.4): [url]http://bugs.php.net/fix.php?id=40615&r=trysnapshot44[/url]
Try a CVS snapshot (PHP 5.2): [url]http://bugs.php.net/fix.php?id=40615&r=trysnapshot52[/url]
Try a CVS snapshot (PHP 6.0): [url]http://bugs.php.net/fix.php?id=40615&r=trysnapshot60[/url]
Fixed in CVS: [url]http://bugs.php.net/fix.php?id=40615&r=fixedcvs[/url]
Fixed in release: [url]http://bugs.php.net/fix.php?id=40615&r=alreadyfixed[/url]
Need backtrace: [url]http://bugs.php.net/fix.php?id=40615&r=needtrace[/url]
Need Reproduce Script: [url]http://bugs.php.net/fix.php?id=40615&r=needscript[/url]
Try newer version: [url]http://bugs.php.net/fix.php?id=40615&r=oldversion[/url]
Not developer issue: [url]http://bugs.php.net/fix.php?id=40615&r=support[/url]
Expected behavior: [url]http://bugs.php.net/fix.php?id=40615&r=notwrong[/url]
Not enough info: [url]http://bugs.php.net/fix.php?id=40615&r=notenoughinfo[/url]
Submitted twice: [url]http://bugs.php.net/fix.php?id=40615&r=submittedtwice[/url]
register_globals: [url]http://bugs.php.net/fix.php?id=40615&r=globals[/url]
PHP 3 support discontinued: [url]http://bugs.php.net/fix.php?id=40615&r=php3[/url]
Daylight Savings: [url]http://bugs.php.net/fix.php?id=40615&r=dst[/url]
IIS Stability: [url]http://bugs.php.net/fix.php?id=40615&r=isapi[/url]
Install GNU Sed: [url]http://bugs.php.net/fix.php?id=40615&r=gnused[/url]
Floating point limitations: [url]http://bugs.php.net/fix.php?id=40615&r=float[/url]
No Zend Extensions: [url]http://bugs.php.net/fix.php?id=40615&r=nozend[/url]
MySQL Configuration Error: [url]http://bugs.php.net/fix.php?id=40615&r=mysqlcfg[/url]
jan dot morten dot sorensen at organizer dot net Guest
-
Flash remoting kills IIS?
Here's a weird one... I'm running CFMX 7, developer edition, on an XP Pro laptop. I'm learning Flash Remoting from the "Flash MX 2004 Pro for Server... -
Make a set variable a link
I'm working on modifying an existing app, but I need to make the #session.SchoolName# below a link - I've tried a few different options, and can't... -
Storing link text to a Cookie or Session Variable
Another one of those "It sounds easy enough to do, but...." I need to store the value/text displayed as a hyperlink to either a Cookie or Session... -
#17248 [Com]: # is not a valid MySQL-Link resource
ID: 17248 Comment by: UglyEugen at yahoo dot com Reported By: bbs at c-se dot de Status: No Feedback Bug Type:... -
flash kills keyCommands
I have a flash sprite on the stage, whenever it is present my on keyDown handler doesnt execute. I have tried other flash sprites in its place and... -
johannes@php.net #2
#40615 [Opn->Bgs]: session_start() kills link resource variable
ID: 40615
Updated by: [email]johannes@php.net[/email]
Reported By: jan dot morten dot sorensen at organizer dot net
-Status: Open
+Status: Bogus
Bug Type: Unknown/Other Function
Operating System: Win2K
PHP Version: 5.2.1
New Comment:
I guess you have register_globals enabled and a session variable
overwriting your local variable. Except for that please report only
bugs related to the latest version of PHP
Previous Comments:
------------------------------------------------------------------------
[2007-02-23 23:08:02] jan dot morten dot sorensen at organizer dot net
Description:
------------
I have version 5.1.2. THIS MIGHT HAVE BEEN FIXED IN 5.2.1!!!
First use mysql_connect() on an included file and return the resource
identifier and store this in a variable.
Then call session_start()
Now you have lost your resource identifier!
Calling session_start() first fixes the problem.
Reproduce code:
---------------
file1.php
function connect_to_db() {
$link = mysql_connect($host, $user, $pass) or die(err_msg);
mysql_select_db($db) or die(err_msg);
return $link;
}
file2.php
include 'file1.php';
$link = connect_to_db();
echo $link;
session_start();
echo $link;
Expected result:
----------------
link resource id# ?
link resource id# ?
replace ? with a number
Actual result:
--------------
link resource id# ?
0
------------------------------------------------------------------------
--
Edit this bug report at [url]http://bugs.php.net/?id=40615&edit=1[/url]
johannes@php.net Guest



Reply With Quote

