| View previous topic :: View next topic |
| Author |
Message |
sek
Joined: 26 Mar 2010 Posts: 30
|
Posted: Mon Jun 28, 2010 1:16 pm Post subject: How to get membership authorised user cookie properties |
|
|
Hi experts..,
I am having a small problem in my project. I just want to get the Cookie properties after the user was logged in.
I am developing a project using ASP.Net MVC. I used Asp.net Membership for user details and authorisation.
I want the Cookie details after the user was logged in.
Actually that cookie generating automatically. So how can i access that cookie. Please help me out
Thanking you all. _________________ Sekhar |
|
| Back to top |
|
 |
rajesh
Joined: 26 Mar 2010 Posts: 43
|
Posted: Mon Jun 28, 2010 1:22 pm Post subject: |
|
|
Hello sek.,
Ya I got your Question.
here I am Producing code. Just use it in your project.
HttpCookie cok = HttpContext.Request.Cookies.Get(FormsAuthentication.FormsCookieName);
try
{
FormsAuthenticationTicket tc = FormsAuthentication.Decrypt(cok.Value);
if (!tc.Expired)
{
....
...
...
..
}
catch {
....
...
}
In this you can get the details of the Cookie.
I hope this is the solution you are looking for. _________________
***************
Best Regards
Rajesh Mani.
Nyros Technologies. |
|
| Back to top |
|
 |
|