Custom UserAdaptor - access to Session Variables

  •  04-13-2005, 10:52 AM

    Custom UserAdaptor - access to Session Variables

    Hi,

    I have developed a Custom provider to integrate Cutechat within our Database User Schema. On the whole it went well and I was able to follow your documentation well but one issue did arise.

    In the UserAdaptor class while implementing the GetUserUniqueName method I found that the HttpContext did not always contain the Session object. Originally we had some user information set in Session Variables (As opposed to User.Identity) but I found that the Session variable were perfectly accessible except for the chat page itself when the Session was null.

    I assumed this was because here you are using some kind HttpHandler to do the actual chat protocal - is it here that the Session variables are lost ? I have had previous issues with this as Implementing a HttpHandler does not by default give access to the Session Variables unless one implements the marker interface IRequiresSessionState.

    I was able to get round this by using the Forms based authentication and getting a User.Identity etc.. I just wondered if access to the Session could be provided, it would still be useful to myself in the custom provider.

    Many thanks again

    Richard Stockley

View Complete Thread