You would mainly store it in a database if your web application is being hosted in a web farm (i.e. across multiple servers). That's because a visitor might connect to different servers on each request, so there is no point in keeping session data in server
memory (inproc) because that can't be shared across servers.
When you have asp.net application with Web API as a Service layer, you may require to store the session specific user and role information in the SQL server.
that Session Id is the commonly referred by the asp.net web application and asp.net Web API as well.
Contributor
2231 Points
3706 Posts
What is the advantage of saving user session in database
Jul 21, 2016 11:29 AM|sudip_inn|LINK
anyone can tell me in what kind of situation people store user session data in database ?
give me example of few scenario where it is required.
thanks
All-Star
194490 Points
28078 Posts
Moderator
Re: What is the advantage of saving user session in database
Jul 21, 2016 11:43 AM|Mikesdotnetting|LINK
You would mainly store it in a database if your web application is being hosted in a web farm (i.e. across multiple servers). That's because a visitor might connect to different servers on each request, so there is no point in keeping session data in server memory (inproc) because that can't be shared across servers.
Member
16 Points
41 Posts
Re: What is the advantage of saving user session in database
Aug 09, 2016 06:51 AM|Selvakumar Rathinam|LINK
Hi,
When you have asp.net application with Web API as a Service layer, you may require to store the session specific user and role information in the SQL server.
that Session Id is the commonly referred by the asp.net web application and asp.net Web API as well.
Thanks
Selva
Selvakumar Rathinam