ASP.Net Cookie Problems -
i have cookie when user loges in:
httpcookie cookie = new httpcookie("username"); cookie.expires = datetime.now.adddays(1.0); cookie.value = txtusername.text; response.cookies.add(cookie);
and reads out in login-page when user visit again:
if (response.cookies["username"] != null) txtusername.text = response.cookies["username"].value;
but when log in, , after log out directly, cookie deleted. has neither exp-date nor value saved.
whot wrong?
if (response.cookies["username"] != null) txtusername.text = response.cookies["username"].value
should
if (request.cookies["username"] != null) txtusername.text = request.cookies["username"].value
Comments
Post a Comment