Re: lack of understanding of principals, identities, and context

From: Lauchlan M (LMackinnon_at_Hotmail.com)
Date: 08/20/03

  • Next message: Lauchlan M: "How to set redirect default on login?"
    Date: Wed, 20 Aug 2003 20:20:22 +1000
    
    

    > HttpContext is request specific (recreated for every request) and
    therefore
    > you'd need to set the user on every request that means creating instance
    of
    > FiveADayPrincipal and assigning it to the Context.User.
    >
    > Therefore there exists methods in Global.asax as
    > Application_AuthenticateRequest as they are called on every request and
    can
    > be used to set the Principal.

    So, if you are not using cookies, what is the best way to maintain state
    across a session? Do you set a session variable, say UserID, when the user
    logs in, and get the user information from this in the Global.asax
    Application_AuthenticateRequest each time to repopulate the context object?

    If you've gone this far with rolling your own solution, why bother with
    setting the MS context authentication stuff on each Global.asax
    Application_AuthenticateRequest, but instead just check the filepath using
    HttpContext.Current.Server.MapPath() (or whatever else you need to configure
    you authentication framework) and set roles and permissions accordingly in
    your own framework (eg session variables)?

    It would not be too heavy (only involving two or three session variables, eg
    userID, role, and permissions).

    What would be the pros and cons of this approach?

    MS have not made their forms authentication framework intuitive at all IMO.

    Lauchlan M


  • Next message: Lauchlan M: "How to set redirect default on login?"

    Relevant Pages

    • Re: Properties instead of Session Variables
      ... Use cookies, viewstate, file, or DB ... Keep in mind that http is stateless that is server side stuff is ... with each new request to recreate the page in its previous state). ...
      (microsoft.public.dotnet.framework.aspnet)
    • Re: DataTable is Filled From DataSet each time a change is made
      ... ADO.NET so that you don't have to connect back to the database each ... mention anything about session variables so that's why I wasn't sure ... >> the Edit link in the EditCommandColumn) a request is made back to the ... thus reloading my page and reinitializing everything and ...
      (microsoft.public.dotnet.framework.adonet)
    • Re: Properties instead of Session Variables
      ... Keep in mind that http is stateless that is server side stuff is ... with each new request to recreate the page in its previous state). ...
      (microsoft.public.dotnet.framework.aspnet)
    • Re: Properties instead of Session Variables
      ... Keep in mind that http is stateless that is server side stuff is ... usually using the viewstate that is an hidden field that is posted ... with each new request to recreate the page in its previous state). ...
      (microsoft.public.dotnet.framework.aspnet)

  • Quantcast