Re: $_SESSION array goes blind when inserting <img src=""> into it



On Jun 29, 10:45 am, Joey33 <konrad...@xxxxxxxxx> wrote:
Hello to all people of good will,

On one page I insert into $_SESSION at 'mykey' a value:

<div onclick="parent.load_pic()" id="foto_0"><img alt="image" src=""/

</div>

It comes from a form and is assigned as usual:
$_SESSION['mykey']=$the_above_long_string

And on another page when I start the session and try to read the
$_SESSION array the $_SESSION['mykey'] is empty.

All the other values set elsewhere are right there in $_SESSION array.

I tried addslashes(), htmlentities() but nothing works. To my surprise
it doesn't work in FF, in IE it's ok.

I also discovered that SRC="" attribute is the problem, when I skip it
or misspell it, everything works fine.

Any idea? Thanks in advance,
Joey_33

it works in both, session stuff is independent of browser!!
however since its html you need to view source to see. try this:

file1.php
<?php
session_start();
$_SESSION['mykey']='<div onclick="parent.load_pic()" id="foto_0"><img
alt="image" src=""></div>';
?>


file2.php
<?php
session_start();
var_dump($_SESSION);
?>

then view the source. It does work in firefox, to see that highligh
right click and view selection source. (cant just use view source
because the view source window doesnt send the cookie header)

I can confident say that it works, IE cannot be different to FF
because the data is sent to the browser as html, the only thing that
is exchanged between the server and the browser is a 32 char long
string of letters and numbers.

.



Relevant Pages

  • Re: query string passing woes........ help... please....
    ... |> | offer any help other than saying that my validation could be FAR more ... I'm a total newbie at php. ... The easiest way for you would be to make the html form called form.php ... $_SESSION array using the same names. ...
    (alt.php)
  • Re: Looking for general advice on security
    ... PHP pages have to be world-readable, ... SSL provides a way for a thief with a browser to communicate with ... cookies because the user can't fake a session with arbitrary contents, ... Try to send a message to the user and see if the mail server ...
    (comp.lang.php)
  • Re: setting session timeout through .htaccess
    ... >In all of my sessions work with PHP the ... >session identifier cookie is set automatically by PHP with an expiry ... >time of the life of the browser... ... their cookie is alive... ...
    (comp.lang.php)
  • RE: [PHP] PHP $_SESSION Expiring in IE
    ... "Do you have pages that detect the browser and feed alternate content ... [PHP] PHP $_SESSION Expiring in IE ... something with that affect that IE might be handling in a wierd way? ...
    (php.general)
  • Re: ASP sessionstate
    ... ASP doesn't know or care what browser it ... ticket number given when the first item is added to the cart. ... How can a Response.Write write to the server screen? ... :> delete the cart file and set the session ...
    (microsoft.public.inetserver.asp.general)