Hi, I am trying to create a website using .net authentication. When the user logs in, there will be some objects i need stored in session as they are frequently used on all authorized pages. So I thought it would make sense to stick it in a session object?
However .net uses cookies to store login state, and if you set isPersistent to true, the user is re-authorised if they close and reload the browser. But now my custom objects are missing from the session (as its a new session).
To overcome this, I implemented the IIdentity interface with a class to store the AuthorizationTicket and the custom objects I need, which is setup in the Application_AuthenticationRequest event in the Global.asax file. This works great and am sure this is the mechanism I need, as I can now access my custom objects directly from Context.User (casting it to my custom Identity object), rather than from the session.
However, it seems rediculous to query the database every time the Appli ...
Go to the complete details ...