From JS client side call, I am trying to update Cookie value that originally created from server Side. Now I just noticed that Cookie is created originally with server side will be without . in Domain Name like "www.abc.com"
But once i tried to update cookie by below code with same name from client side js call it creating 2 cookie with same name and different in Domain Name. When we are trying to create cookie from client side its getting created with ".www.abc.com".
I am using below code to update/create with same name :
if (days) {
var date = new Date();
date.setTime(date.getTime()+(days*24*60*60*1000));
var expires = "; expires="+date.toGMTString();
}
else var expires = "";
document.cookie = name+"="+value+expires+"; path=/; domain="+domainurl ;
How can i delete /update that existing cookie without creating duplicate like below.
Its creating Cookie but some different in domain name with or without "." How to resolved this problem, i have refer different links,link2 but could not find the resolution.
In simple work i need to update cookie value from client side same cookie originally created from server side used across java base Spring MVC application.
Thanks in advance for any kind of help and info.