#17158 [Com]: setcookie()
| From: | webmaster at fatal-instinct dot com | Date: | Thu, 09 Jan 2003 03:31:43 +0000 |
| Subject: | #17158 [Com]: setcookie() | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-29526@lists.php.net to get a copy of this message | ||
ID: 17158
Comment by: webmaster@fatal-instinct.com
Reported By: jtjohnston@courrier.usherb.ca
Status: Closed
Bug Type: Feature/Change Request
Operating System: n/a
PHP Version: 4.2.0
New Comment:
Exactly, PHP is server-side... So this is a restriction of the
server-side theory. Javascript is a client-side browser controlled
language, it is not executed on the server at all.
Previous Comments:
------------------------------------------------------------------------
[2002-05-11 16:37:39] edink@php.net
Javascript cookies are client-side which is an entirely different
thing. If you want to get around header() and setcookie() limitations,
take a look at http://www.php.net/manual/en/ref.outcontrol.php
------------------------------------------------------------------------
[2002-05-11 16:36:26] jan@php.net
this is because JS has dircet access to the browser., whereas PHP has
not. it is a limitation of HTTP in general and cookies in particular.
so the docs are right. no bug -> bogus
------------------------------------------------------------------------
[2002-05-11 16:30:26] jtjohnston@courrier.usherb.ca
setcookie() states "cookies must be sent before any other headers are
sent (this is a restriction of cookies, not PHP).
http://www.php.net/manual/en/function.setcookie.php
I would like to suggest this is a restriction of PHP, not cookies.
I can send and read cookies right in the middle of my HTML
when I use Javascript:
http://www.collegeSherbrooke.qc.ca/languesmodernes/cookie.htm
<script>
setCookie("TestCookie","first time",expdate);
var DisplayData = getCookie("TestCookie");
document.write(DisplayData);
document.write("<br>");
setCookie("TestCookie","second time",expdate);
var DisplayData = getCookie("TestCookie");
document.write(DisplayData);
</script>
When can we expect a feature change on setcookie() ?
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=17158&edit=1