Featured post
cookies - ASP.NET: How to get FormsAuthenticationTicket object when authentication expired -
i'm trying check expired property of user's current formsauthenticationticket see if authentication period has expired. when period has expired, i'm never able enough information create ticket check. i've tried this:
formsidentity id = (formsidentity)user.identity; formsauthenticationticket ticket = id.ticket;
but user null when authentication period has expired. won't work. i've tried this:
httpcookie authcookie = context.request.cookies[formsauthentication.formscookiename]; formsauthenticationticket authticket = formsauthentication.decrypt(authcookie.value);
but forms cookie gone when authentication period has expired, meaning authcookie null. doesn't work.
is there way get formsauthenticationticket object when authentication period has expired? there must be, because there's "expired" property in object. missing?
thanks.
an expired cookie left out of headers client browser. there no code-behind method of retrieving since client never give you. might possible use javascript cookies retrieve raw cookie data , put post header or ajax call purpose, believe javascript cookie mechanism has same expiration restrictions browser. expired cookies no longer valid, , not accessible.
- Get link
- X
- Other Apps
Comments
Post a Comment