And you can do so if you turn on output buffering.  Having PHP send off
JavaScript to do this is a massive hack that has no place in PHP.  Write
your own setcookie wrapper function if that is what you want.

-Rasmus

On Sat, 11 May 2002, jtjohnston wrote:

> Rasmus
> server-side / client-side, that's not the point.
>
> My point is PHP can, could and should be able to set a cookie after HTML is
> set.
> But of course, Jan has already closed the issue, as usual.
> http://bugs.php.net/bug.php?id=17158
>
>
>
>
> > PHP is a server-side language and as such it deals with server-side
> > issues.  If you want to write javascript that sets a client-side
> > Javascript cookie, go ahead.  It has nothing to do with PHP and PHP will
> > certainly not get in your way.
> >
> > -Rasmus
> >
> > On Sat, 11 May 2002, jtjohnston wrote:
> >
> > > This is a bug "Feature/Change Request" I made to:
> > > http://bugs.php.net/bug.php?id=17158
> > >
> > > setcookie() states "cookies must be sent before any other headers
> > > are sent (this is a restriction of cookies, not PHP).
> > >
> > > I argue this is a restriction of PHP, not cookies.
> > >
> > > Here is my proof:
> > >
> > > http://www.collegeSherbrooke.qc.ca/languesmodernes/cookie.htm
> > >
> > > I can do this any time in <body> :
> > >
> > > <script>
> > >    setCookie("TestCookie","first time",expdate);
> > >    var DisplayData = getCookie("TestCookie");
> > >    document.write(DisplayData);
> > >    setCookie("TestCookie","second time",expdate);
> > >    var DisplayData = getCookie("TestCookie");
> > >    document.write(DisplayData);
> > >  </script>
> > >
> > > I want to be able to setcookie() anytime I want, before and after I
> > > declare any HTML.
> > > This will never get changed, unless we ask for it.
> > >
> > > I would appreciate your vote of support at:
> > >
> > > http://bugs.php.net/bug.php?id=17158
> > >
> > > before the bug people "close" this thread.
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> > >
>
> --
> John Taylor-Johnston
> -----------------------------------------------------------------------------
>
>   ' ' '   Collège de Sherbrooke:
>  ô¿ô   http://www.collegesherbrooke.qc.ca/languesmodernes/
>    -     Université de Sherbrooke:
>           http://compcanlit.ca/
>           819-569-2064
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to