Click here to Skip to main content
15,887,135 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
I want to access Forms Authentication in global.asax's session_end event. basically, i want to get encrypted id which is stored in the cookie and based on that id I want to update user details.

What I have tried:

I have tried to access cookie but it always gives me a null reference.
Posted
Updated 23-Jul-17 20:36pm

1 solution

The http context is not available in this event so you will not be able to access cookie. Instead you can use Application state and add userid to application variable once user is authenticated. Now, on session_end event you can fetch userid from application variable and set it to null in the same event. I hope this helps.
 
Share this answer
 
Comments
Dev_TechnoLabs 24-Jul-17 9:11am    
@Atlapure Ambrish.... Thanks for your response I will try this solution.
Atlapure Ambrish 25-Jul-17 3:51am    
Sure, accept the solution once you try and it works for you, so that it will be helpful to others as well.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900