我在javascript中设置了一个cookie,就像这样
function setCookie(c_name,value,exdays)
{
var exdate=new Date();
exdate.setDate(exdate.getDate() + exdays);
var c_value=escape(value) + ((exdays==null) ? "" : "; expires="+exdate.toUTCString());
document.cookie = c_name + "=" + c_value;
}
var loginval = slmgusername=swetha.p + slmguserpassword = 12345678;
setCookie("slmgusercredentails", loginval, 100);
我控制器我在我的cookie中得到这样的值
HttpContext.Request.Cookies["slmgusercredentials"].Values = {slmgusername%253Dswetha.p%2526slmguserpassword%253D12345678}
当我试图从中获取用户名时,例如
UserName = HttpContext.Request.Cookies["slmgusercredentials"].Values["slmgusername"].
我无法获得用户名。正如我所认为的那样,这些值采用 javscript 编码格式。如何获取用户名...谁能帮我找到解决方案...