View Single Post
  #4 (permalink)  
Old December 30th, 2007, 04:46 AM
Imar's Avatar
Imar Imar is offline
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Yes, I did. Thank you. Hope you had a good time too....

Interesting situation; thanks for posting a follow up. There's one minor thing in your code I noticed:
Code:
protected void Application_AcquireRequestState(object sender, EventArgs e)
  {
       if (HttpContext.Current.Session == null)
       {
           //do nothing
       }
       else
       {
           if (Session["CSLA-Principal"] != null)
           {
             // Not null
           }
           else
           {
              // Is Null
               if (System.Threading.Thread.CurrentPrincipal.Identity.IsAuthenticated)
               {
                  // 
               }
               else
               {
                  // This will crash, right? 
                  // Session["CSLA-Principal"] IS null....
                   System.Threading.Thread.CurrentPrincipal = (System.Security.Principal.IPrincipal)Session["CSLA-Principal"];
               }
           }
       }
   }
   Looks like you can end up in a situation where Session["CSLA-Principal"] is NULL, yet you try to access it.

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.