Do we affect multiple users in ASP.NET when we set the Thread CurrentCulture/CurentUICulture?

Posted by Nikolay on Stack Overflow See other posts from Stack Overflow or by Nikolay
Published on 2010-05-19T07:30:38Z Indexed on 2010/05/19 7:40 UTC
Read the original article Hit count: 342

When we set the CurrentCulture and/or CurrentUICulture we do this on the current thread like this:

Thread.CurrentThread.CurrentCulture = new CultureInfo("en-GB");
Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-GB");

Doest this mean we could affect the culture settings of multiple users of our web application as their requests may reuse the threads from pool?

I am working on an ASP.NET MVC application where each user may have own culture setting specified in his/her account data. When the user logs in, the culture setting is retrieved from the database and has to be set as current culture.

My worry is that setting the current culture on the current thread may affect another user request reusing this thread. I am even more concerned reading this:

ASP.NET not only uses a thread pool, but may switch threads during request processing.

© Stack Overflow or respective owner

Related posts about asp.net-mvc

Related posts about localization