Cookies

G

Guest

hi
my question is if i have a way to change the value of a cookie that
i have created in the server with javascript in the client.
 
G

Guest

Diego,

I believe that you can do this by accessing the document.cookies collection
in javascript. There are many tutorials if you do a web search for it. I
have posted a link to one for you below.

If I have misunderstood your question please reply to this post so I may
better help.

I hope this helps.
 
G

Guest

hi brian

my problem is that i create a cookie on the server using
->this.Response.Cookies.Add(new HttpCookie("cookieName","cookieValue"));
but then i want to change the value of the cookie in the client using
javascript
registering this client script block
-><script language="javascript" type="text/javascript">
-> document.cookie = "cookieName= cookieNewValue";
-></script>
but it doesn´t work

Thanks Diego
 
G

Guest

Hi Diego,

I believe that you need to set the path to "/" for the cookie in the
javascript (e.g. document.cookie = "cookieName= cookieNewValue;path=/";

Please let me know if this works for you.

Hope this helps.
----------------------------
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top