答复: [PHP]COOKIE or coding
| From: | Zhao chunliang[chunliang.zhao] | Date: | Wed, 05 Nov 2008 09:52:10 +0000 |
| Subject: | 答复: [PHP]COOKIE or coding | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-282909@lists.php.net to get a copy of this message | ||
Dear: all
That is very abnormality.
1.Open the url : http://127.0.0.1/showCookie.php
ShowCookie.php code:
<?php
var_dump($_COOKIE);
?>
That's print:
[TCSPUBLICJAUTHM] =>
USER_ID=/zhW/2QXY/GUtIN7m4 dNQ==
2. The same window, input the string
"javascript:alert(document.cookie);" and enter, it's show :
That's print:
[TCSPUBLICJAUTHM] =>
USER_ID=/zhW/2QXY/GUtIN7m4+dNQ==
3. now , I change the showCookie.php
<?php
echo "<script>alert('" .
$_COOKIE['TCSPUBLICJAUTHM'] . "');</script>";
var_dump($_COOKIE);
?>
That's print:
[TCSPUBLICJAUTHM] =>
USER_ID=/zhW/2QXY/GUtIN7m4 dNQ==
I think the cookie in php being changed.
Look forward to your help