Basic Cookie question 
Author Message
 Basic Cookie question

Sorry, but a very basic question on cookies, I cant find the answer in
Google.

I've managed to set a cookie value in PHP

I've managed to read back that cookie value in PHP.

The question is how do I change the cookie value?   I don't seem to be able
to just use setcookie("cookie name", "newcookie value").

I've also tried

<? setcookie("cookie name", "", time()-20000);
 setcookie("cookie name", "newcookie value");
?>
but that doesn't seem to work either.



Thu, 21 Jul 2005 09:45:10 GMT  
 Basic Cookie question

Quote:
> Sorry, but a very basic question on cookies, I cant find the answer in
> Google.

> I've managed to set a cookie value in PHP

> I've managed to read back that cookie value in PHP.

> The question is how do I change the cookie value?   I don't seem to be
> able to just use setcookie("cookie name", "newcookie value").

> I've also tried

> <? setcookie("cookie name", "", time()-20000);
>  setcookie("cookie name", "newcookie value");
> ?>
> but that doesn't seem to work either.

$_COOKIE['name'] = value;

i.e. $_COOKIE['username'] = 'bobsmith';

(If I recall though, you do not get the updated value until the next page,
or is that with $_SESSION? Gah, I can't remember, I need more caffein... I
have been coding all day long :-()

--
// Agelmar
-
"The high office of President has been used to foment a plot to destroy the
Americans freedom, and before I leave office I must inform the citizen of
his plight." - JFK



Thu, 21 Jul 2005 09:51:40 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. cookie basics again

2. cookie basics

3. ANNOUNCE: Cookie.py A module to manage create web cookies

4. Toss your cookies (Mozilla cookie file filter)

5. SID Cookie Sharing Question

6. cookie question

7. Cookie Questions

8. How to set a cookie??? - Newbie question

9. Cookies question

10. TCL CGI Cookie Question

11. Cookie question

12. Device Driver: from Apple III BASIC to IBM BASIC

 

 
Powered by phpBB® Forum Software