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:

  1. why cookie isn't being set value
  2. why it's listed twice
  3. 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

Popular posts from this blog

c# - Update a combobox from a presenter (MVP) -

How to understand 2 main() functions after using uftrace to profile the C++ program? -

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -