Pergunta

When the application is served from a web farm, a Session object CANNOT be used. Is that true?

Foi útil?

Solução

No, you can use SQL-based sessions which can then in theory be accessed by any server in the web farm, with the correct configuration.

For a little more information : Configure SQL Server to Store ASP.NET Session State

Outras dicas

Not so much cannot.

It depends on what you use & how you use it. If you're using sticky load balancer & it's configured as such, then each subsequent request from a user will always hit the same member node in the farm, in which case session use is ok.

If you have no such load-balancer or it's configured so that any request can be handled by any node, then you need to either use a 3rd party state service, such as asp.net provides, or disable the session. a 3rd party or out-of-process session service has certain restrictions on how you use it however, so if you go down that route, you'll need to research & test any solution.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top