Click here to Skip to main content
15,918,889 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
When i want to replace old attribute language values of cookie inside browser it's working in local server but when i deployed on live server it's not replacing the particular language attributes old value with new value.it's adding same language attribute two times one with new value other with old value and browser consider old values so language doesn't change for website in firefox3.5 versions.can you give yrour suggestion.
Thanks in advance.
Posted

1 solution

Showing us some code would help. I'll assume you're doing this on the server.

To replace a cookie's value have you tried removing it, then adding it back with the new value?

C#
// Get the current outbound cookie so we can remove it and replace it with an update.
HttpCookie cookie = HttpContext.Current.Response.Cookies[key];
if (cookie != null)
    HttpContext.Current.Response.Cookies.Remove(key);

cookie = new HttpCookie(key);
cookie.Value   = value;
cookie.Expires = ...

HttpContext.Current.Response.Cookies.Add(cookie);
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900