PhilePage Session ?
Can someone explain to me how the PhilePrincipal is persisted from page to page?
Why is this line in the PhilePage's Page_Load event:
"if (!(Context.User is PhilePrincipal))"
It seems to create (go to the DB) PhilePrincipal on EVERY request. I can't find an explanation in the book as to why this check is done. The Context.User will NEVER be (PhilePrincipal)Context.User.???
Wouldn't we want to serialize PhilePrincipal into a Session variable and just grab that every time?
I'm guessing this is just another example of how the authors present a technique but leave it up to the reader to research WHY it is being done.
This is a very thought provoking book. Luckily, we have this forum to fill in the blanks!
Thanks,
Jay
|