I am developing a site using the book as a guideline and I ran into this as well. The problem (for me at least) is that the Page_Load event runs for the inherited class before it runs for the base site page class...so the Context.User has not been populated with a SitePrincipal before the page attempts to cast it as such.
When I read the chapter on the PhilePage sitewide page class, I did not understand how registering for the Page_Load (in the PhilePage OnInit method) event would guarantee that the base PhilePage_Load would be called first. From my understanding of .NET events, the order in which delegates are called is not specified. So even though the base PhilePage_Load delegate is registered first, it does not necessarily get called first. When I run in the debugger, the Page_Load for the Page is executed before the base PhilePage_Load.
I solved the problem by placing the code from the PhilePage_Load into an override of the PhilePage OnLoad method. I placed the code before a call to the base.OnLoad method to ensure it would execute first.
I do not understand how the code could work as written so I hope someone comments on what guarantees the order of execution of the Page_Load event handlers.