Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > FormsAuthenticationTicket

Reply
Thread Tools

FormsAuthenticationTicket

 
 
Morgan
Guest
Posts: n/a
 
      12-08-2003
Thanks in advance for any info...

Using web services, I am authenticating users and returning a valid
FormsAuthenticationTicket as a string, with an expiration of 20 minutes.
This is all fine and good. However, I would like to extend the expiration
each time the ticket is accessed. I found the
FormsAuthentication.RenewTicketIfOld method, but it won't allow me to
convert the string to a forms authentication ticket. Any ideas?

Private Function Login(...) as String
Dim ticket As New FormsAuthenticationTicket(userID, False, 1)
Dim encryptedTicket As String = FormsAuthentication.Encrypt(ticket)
'get the ticket timeout in minutes
Dim configurationAppSettings As AppSettingsReader = New AppSettingsReader()
Dim timeout As Integer =
CInt(configurationAppSettings.GetValue("Authentica tionTicket.Timeout",
GetType(Integer)))
'cache the ticket (timeout is 20)
Context.Cache.Insert(encryptedTicket, userID, Nothing,
DateTime.Now.AddMinutes(timeout), TimeSpan.Zero)
Return encryptedTicket
End Function

Thanks,

Morgan


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
When to use FormsAuthenticationTicket() =?Utf-8?B?QW5kcmV3?= ASP .Net 1 12-23-2005 10:23 PM
Application should not be Expire time in ASP.net (using this FormsAuthenticationTicket ) karunakar ASP .Net 2 03-15-2005 09:38 AM
Cookie and FormsAuthenticationTicket Question... Kiran B. ASP .Net 5 01-04-2005 04:38 PM
Functions of FormsAuthenticationTicket Grey ASP .Net 1 07-16-2004 12:54 AM
How can I read login details from FormsAuthenticationTicket ? Fresh Air Rider ASP .Net 2 02-29-2004 04:40 PM



Advertisments