开发者

How to access the Forms Authentication Ticket in Authenticated pages

I have used the Forms Authentication for logging in and in that i have created the Forms Authentication Ticket and in that ticket i have passing the data with comma seperated values. how can i get the data which is in the ticke开发者_如何学Pythont to access in the Authenticated user pages

How can i do this?

Thanks & Regards, Vara Prasad.M


Request.Cookies[FormsAuthentication.FormsCookieName] will give you the Forms Authentication cookie.

FormsAuthenticationTicket ticket = FormsAuthentication.Decrypt(cookie.Value); will take that cookie and turn it into the FormsAuthenticationTicket.

From there you can access all sorts of properties. It sounds like you'll want Name and/or UserData.

You can follow this process from any place you can get an HttpRequest instance... which is pretty much everywhere.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜