Hi All,
Here I'm using ASP to write a cookie value and reading the same in JavaScript. But the problem is whenever there is a space in cookie value( like here there is space between "LastName" & "FirstName", it's displayed as "LastName+FirstName" while reading the same cookie in JavaScript . I would like to know how to avoid this "+" symbol?
<%@ Language=vbScript%>
<%
Response.Cookies("name") = "LastName FirstName"
Response.Cookies("name").Path = "/"
Response.Write("Cookie Value: " & Request.Cookies("name"))
%>
<html>
<head>
<script language="javascript" >
alert("Cookie value :" + unescape(document.cookie));
</script>
</head>
</html>
Here I'm using ASP to write a cookie value and reading the same in JavaScript. But the problem is whenever there is a space in cookie value( like here there is space between "LastName" & "FirstName", it's displayed as "LastName+FirstName" while reading the same cookie in JavaScript . I would like to know how to avoid this "+" symbol?
<%@ Language=vbScript%>
<%
Response.Cookies("name") = "LastName FirstName"
Response.Cookies("name").Path = "/"
Response.Write("Cookie Value: " & Request.Cookies("name"))
%>
<html>
<head>
<script language="javascript" >
alert("Cookie value :" + unescape(document.cookie));
</script>
</head>
</html>