Is it safe to use a session in a cloud application?

We plan to migrate one of our applications to the cloud, but somewhere I read that using a session in the cloud can be dangerous. but this blog does not explain any danger as such.

I wanted to know if there was any real threat when using a session for cloud applications?

I am new to the forum, so sorry if I made any mistake and please direct me to fix the same.

+8
c # cloud
source share
2 answers

If you plan to run the application on multiple nodes, you will need to consider load balancing and out-of-process sessions, but there is nothing significant in that you do not use sessions, and the servers are located somewhere else.

It just doesn't make any sense.

+3
source share

If โ€œdangerousโ€ means that in certain situations the use of the session will not work, then you are right to use Azure to host the cloud application. Then it depends on the number of instances you run.

If you use only one instance, you can use Session (which lives in memory on the instance) without changing anything. But if you use more than one instance (requests are load balanced and each request can be processed in another instance) in memory, the Session will not work out of the box. To solve this problem, you can use 3 different ways to store the session.

See this question for more information: ASP.NET Session State Provider in Azure

+1
source share

All Articles