Vibrant discussion about CSLA .NET and using the framework to build great business applications.

Forum has moved

New location: CSLA .NET forum

CSLA .NET Resources:
  • CSLA .NET forum
  • CSLA .NET home page
  • Asp.Net MVC Custom Principal losing information

    rated by 0 users
    Not Answered This post has 0 verified answers | 1 Reply | 1 Follower

    Not Ranked
    13 Posts
    RandyH posted on Mon, Oct 10 2011 10:19 AM

    If I have a user "A" logged in, then when user "B" pulls up the site (without logging in), then user "A" custom identitiy properties are lost. This also occurs if both users are logged in and one of the users logs out.

    The custom pricipal object is being stored in session. Session is being maintained by Asp.Net Session State Service.

        Private Sub ShellApplication_AcquireRequestState(ByVal sender As ObjectByVal e As System.EventArgsHandles Me.AcquireRequestState
            If (TypeOf HttpContext.Current.Handler Is IRequiresSessionStateThen
                If (Csla.ApplicationContext.AuthenticationType = "Windows"Then
                    Exit Sub
                End If
                Dim principal As System.Security.Principal.IPrincipal
                    principal = CType(Session(SessionKey.CslaPrincipal), System.Security.Principal.IPrincipal)
                    principal = Nothing
                End Try
                If (principal Is NothingThen
                    If User.Identity.IsAuthenticated AndAlso TypeOf User.Identity Is FormsIdentity Then
                    End If
                    ' use the principal from Session
                    Csla.ApplicationContext.User = principal
                End If
            End If
        End Sub
    I am using CSLA 4.1. I have csla.dll, csla.web.dll, and csla.web.mvc.dll referenced in my projects.
    Any help would be GREATLY appreciated!

    All Replies

    Top 10 Contributor
    9,475 Posts

    Maybe this thread would help:



    Page 1 of 1 (2 items) | RSS

    Copyright (c) 2006-2014 Marimer LLC. All rights reserved.
    Email admin@lhotka.net for support.
    Powered by Community Server (Non-Commercial Edition), by Telligent Systems