setcookie only sends the information to the client to set their own cookie.
$_COOKIE is a superglobal that is set before PHP script is ran.

So, you will need to use setcookie (for future requests) and
manipulate your current global cookie variable (for the current
request). I believe you have to use global $_COOKIE to set the
$_COOKIE associative array throughout your script, if you don't I
believe it will only change the local version of the $_COOKIE array.

Hopefully, I have been able to help. Maybe google 'php $_COOKIE
superglobal' for more info, because I do not know if this raises any
security concerns or other problems.

Craig Jackson

On Thu, Apr 24, 2008 at 12:10 AM, Wade Preston Shearer
<[EMAIL PROTECTED]> wrote:
>
> > Instead of a redirect, what about setting the global
> > $_COOKIE['cms_site_lang'] = $id? Or, REQUEST if that is the one you
> > are using.
> >
> > global $_COOKIE;
> > $_COOKIE['cms_site_lang'] = $id;
> >
>
>  That works and is a very simple solutions. Can you explain to me how that
> works though? How can I set the cookie and use it's value before the page
> reloads?
>
>

_______________________________________________

UPHPU mailing list
[email protected]
http://uphpu.org/mailman/listinfo/uphpu
IRC: #uphpu on irc.freenode.net

Reply via email to