Nancyfx load balanced session web server

Nancyfx uses a cookie based session. It encrypts cookies using a unique key that it generates when the application starts. If you need to have an application on several servers (load balance), each instance of the application will generate its own key at startup and use it to encrypt and decrypt cookies.

This means that when a request is sent between servers for one user session, a cookie saved from the first computer cannot be read on the next computer. I tried to solve the problem by providing nancy with a custom key generator that always produces the same key, but the problem still exists.

Is there any thing I'm missing here, or is there another solution?

+4
source share
1 answer

When you turn it on, you pass CryptographyConfiguration, one of the ones we provide in this field is based on the password that you use in load-balanced scripts or when you want to keep valid for restarting applications.

Here is more information about cryptography:

https://github.com/NancyFx/Nancy/wiki/The-cryptography-helpers

And here about load balancing here:

https://github.com/NancyFx/Nancy/wiki/Forms-Authentication

+4
source

Source: https://habr.com/ru/post/1531294/


All Articles