views:

377

answers:

1

Hi there, guys.

I'm currently developing an ASP.NET website, and I'm using ASP.NET's built-in Login control with client-side cookie generation for state management.

Unfortunately, as I didn't figure out how to append custom information (generated by other controls on my application) to the Login control self-generated cookie, my application generates an additional cookie to store that additional info. Basically, I have two cookies: one managed by the Login control and another managed by me, programatically.

What I would like to know is if it's possible to merge my additional information into the infrastructure's Login control self-generated cookie. This would prevent some issues with the "sliding timeout" feature that could result on my "custom cookie" expiring with the user being logged in - I could solve this one with a custom HTTP Module to prevent it, but that seems to me as an "inelegant" solution.

Any brilliant mind could help me out with this?

Thanks in advance for your attention and support.

+2  A: 

Yes, you can store data in the UserData property of the authentication ticket. Please see the section "Storing the Username of the Admin User Who Logged On As Another User" at http://www.4guysfromrolla.com/articles/102208-1.aspx

However, you might find the User Profile system to be more useful. http://www.4guysfromrolla.com/articles/101106-1.aspx

Greg
Thank you very much for your help! I appreciated it!
XpiritO