RE: How to share a Principal within a ThreadPool ?

From: Dominick Baier [DevelopMentor] (dbaier_at_pleasepleasenospamdevelop.com)
Date: 04/27/05


Date: Wed, 27 Apr 2005 05:45:34 -0700

Hello Aleksandr,

That's not true. Context.User is for the current thread only. And you have
to do that for every request, e.g. in Application_AuthenticateRequest. This
is the recommended way of doing it.

---------------------------------------
Dominick Baier - DevelopMentor
http://www.leastprivilege.com

>> Hi,
>> when I set a Principal in the current thread, using :
>> Thread.CurentPrincipal =
>> the Principal object is not set in the other threads of the
>> application
>> threadpool.
>> Is there a special way to do that ?
>> Oriane
> If You write an ASP.NET application use Context.User instead of
> Thread.CurrentPrincipal.
> Contexct.User sets principal for all threads.
> You can also use AppDomain.SetThreadPrincipal
> But this method could be used only once.