0

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

Stefan Fachmann
  • 555
  • 1
  • 5
  • 18

2 Answers2

1

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

ChrisBint
  • 12,773
  • 6
  • 40
  • 62
0

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.

Simon Halsey
  • 5,459
  • 1
  • 21
  • 32