Ask a Question related to ASP.NET Security, Design and Development.
-
mitch #1
Manually created Cookie with UserData won't persist
I'm manually creating a FormsAuthenticationTicket and adding userdata.
The problem is that the cookie won't persist.
Code:
--------------------------------------------------------------------
Dim isPersistent As Boolean = Remember.Checked
Dim userData As String = "RecordNumber"
Dim ticket As New FormsAuthenticationTicket(1,strEmail,System.DateTi me.Now,System.DateTime.Now.AddMinutes
(30),isPersistent,userData,FormsAuthentication.For msCookiePath())
' Encrypt the ticket.
Dim encTicket As String = FormsAuthentication.Encrypt(ticket)
' Create the cookie.
Dim authCookie as New
HttpCookie(FormsAuthentication.FormsCookieName(), encTicket)
authCookie.Path = FormsAuthentication.FormsCookiePath()
If isPersistent = True
Then authCookie.Expires = DateTime.Now.AddYears(50)
End If
'Write the cookie
Response.Cookies.Add(authCookie)
----------------------------------------------------------------------
I have another application (same client/server setup) that uses:
FormsAuthentication.RedirectFromLoginPage(Email.Te xt,
Remember.Checked)
and this cookie persists fine.....
Using IE6 and W2K server.
Thanks
Mitch
mitch Guest
-
Storing Print Presets in a Manually Created PDF
I am a Progress programmer creating/printing PDF documents from reports written in Progress by wrapping a PDF shell around the document. Having... -
Can't persist the cookie
ticket is an instance of FormsAuthenticationTicket; HttpCookie cookie = new HttpCookie(FormsAuthentication.FormsCookieName,... -
manually created template column databind
Because of the project requirement I have to generate the datagrid dynamically. I created a template column manually in the code and going to add... -
How do I update FormsAuthenticationTicker.userdata after ticket created?
When a user logs on to an application the new FormsAuthenticationTicket is created with a userdata field which I can populate with anything useful I... -
Cookie not always created in client
I have the following login code: private void Login() { string strRole;



Reply With Quote

