Closed
Bug 358123
Opened 18 years ago
Closed 14 years ago
firefox 2.0final not consistently registering session variables that are set from php(or other script languages) files that are called from within <img> tags
Categories
(Core :: Networking: Cookies, defect)
Tracking
()
RESOLVED
INCOMPLETE
People
(Reporter: geuis.teses, Unassigned)
Details
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1) Gecko/20061010 Firefox/2.0
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1) Gecko/20061010 Firefox/2.0
Will be as detailed as I can.
I am writing a CAPTCHA verification script in PHP that is using session variables for validation.
Primary file: index.php
1)Generate session/continue previous session with session_start();
2)Include 2nd php file that contains html, include('page.php');
Secondary file: page.php
1)has this html "<html><body> <img src='images/captcha.php'/>"
2)when rendered in the browser, the <img src... treats images/captcha.php as an image file.
Third file: images/captcha.php
1)Contains php code that generates the jpeg image that the browser displays.
2)Shortened code as follows(not call code is being included because it doesnt apply to this situation):
<?
session_start();
$key = md5($session_id);
imagejpeg($image);
imagedestroy($image);
$_SESSION['security_code'] = $key;
?>
At this point, the browser accessing index.php, which includes page.php, will get the <img> tag and will properly display the dynamic image being generated by captcha.php.
However, most of the time the $key that is being set in the session by $_SESSION['security_code'] is not registering in Firefox2.0
If I remove the image generating code from the captcha.php file and then include it from index.php in the same manner as page.php, include('captcha.php'); then the $key IS being set normally in the session. I have tested this back and forth and it seems consistent.
A handful of times, I have gotten the captcha.php accessed via <img> to set the $key in the session, but only after directly accessing the file as a jpeg and refreshing 10-20 times. Then the rest of the code works, until I reset my cookies and sessions or close and open the browser and not restoring previous sessions. (ala session saver) Then it all goes back to the problem I previous described.
Overall, it seems that if FF2.0 is loading a file from an <img> tag, it has a problem letting that file interact with the current session.
I also believe this behavior was present in FF1.5.0.7 because I began troubleshooting this earlier today at work where I have not upgraded FF yet to 2.0.
Finally, while I very much hate to say it, the very same CAPTCHA script was working in IE6.0 (yeah, that's not saying much.)
Reproducible: Sometimes
Reporter | ||
Updated•18 years ago
|
Version: unspecified → 2.0 Branch
Updated•18 years ago
|
Component: Security → Networking: Cookies
Product: Firefox → Core
QA Contact: firefox → networking.cookies
Version: 2.0 Branch → 1.8 Branch
Comment 1•14 years ago
|
||
Please provide a testcase or a cookie log if you still get this in Firefox6.0 or later
Status: UNCONFIRMED → RESOLVED
Closed: 14 years ago
Resolution: --- → INCOMPLETE
You need to log in
before you can comment on or make changes to this bug.
Description
•