U
UJ
I am doing the following code using cookies but the cookies never seem to being set. Is there more I need to do? Is there some web.config option I need to change?
Here's the code:
On page load:
If Not IsPostBack Then
Dim cookLastLogin As HttpCookie
cookLastLogin = Response.Cookies("LastLogin")
if Not cookLastLogin.Value Is Nothing Then
Me.txtUserName.Text = cookLastLogin.Value
End If
End If
After the person has clicked my login button I do:
If Me.cbRememberMe.Checked Then
Response.Cookies("RememberMe").Value = "Y"
Response.Cookies("LastLogin").Value = txtUserName.Text
Response.Cookies("LastLogin").Expires = DateTime.Now.AddYears(30)
Else
Response.Cookies("RememberMe").Value = "N"
Response.Cookies("LastLogin").Value = txtUserName.Text
Response.Cookies("LastLogin").Expires = DateTime.Now.AddYears(-1)
End If
Response.Cookies("RememberMe").Expires = DateTime.Now.AddYears(30)
The values for LastLogin don't appear to ever be saved.
TIA - J.
Here's the code:
On page load:
If Not IsPostBack Then
Dim cookLastLogin As HttpCookie
cookLastLogin = Response.Cookies("LastLogin")
if Not cookLastLogin.Value Is Nothing Then
Me.txtUserName.Text = cookLastLogin.Value
End If
End If
After the person has clicked my login button I do:
If Me.cbRememberMe.Checked Then
Response.Cookies("RememberMe").Value = "Y"
Response.Cookies("LastLogin").Value = txtUserName.Text
Response.Cookies("LastLogin").Expires = DateTime.Now.AddYears(30)
Else
Response.Cookies("RememberMe").Value = "N"
Response.Cookies("LastLogin").Value = txtUserName.Text
Response.Cookies("LastLogin").Expires = DateTime.Now.AddYears(-1)
End If
Response.Cookies("RememberMe").Expires = DateTime.Now.AddYears(30)
The values for LastLogin don't appear to ever be saved.
TIA - J.