ID: 42791 Comment by: martin at limitless dot co dot uk Reported By: dron007 at yahoo dot com Status: No Feedback Bug Type: Session related Operating System: Linux PHP Version: 5.2.4 New Comment:
I have recently come across this bug in PHP Version 5.1.4. The code was <img src="#"> that caused the session variables to reset. The system is running Apache 1.3 on Solaris 10. If I can provide any other useful information, just let me know. Previous Comments: ------------------------------------------------------------------------ [2007-10-07 01:00:01] php-bugs at lists dot php dot net No feedback was provided for this bug for over a week, so it is being suspended automatically. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to "Open". ------------------------------------------------------------------------ [2007-10-01 10:37:44] dron007 at inbox dot ru Yes, that was IE6. With FF and Opera everything works fine. Probably that is browser issue but it is very weird thing because if I add another session variable that is not nulled IE shows this variable and doesn't show nulled one. FF shows both of them. That means that session cookie is sent in both cases. Also if I move $_SESSION["some_var"] = null; inside "if" statement it works fine too. ------------------------------------------------------------------------ [2007-09-29 02:36:46] [EMAIL PROTECTED] With what browser are you trying this with? IIRC, there was some issue with IE and broken html and it not sending some headers then. ------------------------------------------------------------------------ [2007-09-28 17:55:24] dron007 at yahoo dot com Description: ------------ There was the bug already posted: http://bugs.php.net/bug.php?id=25966 I also have the similar situation. IMG tag with empty src attribute deletes session variable. Yes, it is incorrect <IMG> tag but I spent a lot of time debugging this situation and I was very surprized that HTML code have an influence on PHP variables. Reproduce code: --------------- File 1.php: <? session_start(); $_SESSION["some_var"] = null; if (isset($done)) { $_SESSION["some_var"] = 1; header("Location: 2.php"); die(); } ?> <a href="1.php?done=1">Goto 2</a> --------------------------------------- File 2.php: <? session_start(); echo 'some_var='.$_SESSION["some_var"].'<br>'; echo '<img src="">'; ?> Expected result: ---------------- I first load file 1.php, then go by link which sets session variable, then I see "some_var=1" which is correct. If I reload 2.php I expect to see "some_var=1" Actual result: -------------- "some_var=" Session variable is destroyed. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=42791&edit=1