Cookies not being written to browser in C# asp.net -
i'm using following code write cookie containing user's current uri.
httpcookie mycookie = new httpcookie("lastpage"); mycookie.domain = ".xxxxxxx.xxx"; mycookie.value = request.url.absoluteuri; mycookie.expires = datetime.now.addminutes(30); response.cookies.add(mycookie); on different page in same domain list cookies
foreach (string thiskey in request.cookies.allkeys) { htmlgenericcontrol li = new htmlgenericcontrol("li"); httpcookie thiscookie = request.cookies[thiskey]; li.innerhtml = thiscookie.name + " = " + thiscookie.value; ulcookies.controls.add(li); } for reason not lastpage listed twice it's in caps , blank both times. don't know why. can please explain:
- why cookie isn't being set value
- why it's listed twice
- how got capitalized
the first 1 important. executed code in both page_load , page_init functions. i'm using .net 3.5 , visual studio 2013. in advance.
Comments
Post a Comment