My website/application is in ASP.NET. I use the traditional Session object when people connect so they have their preference, etc.
My problem is that sessions were lost very often. I discovered that my hosting company was using load balancing on their servers, so one request on my website can be on one server, and the other on another one.
I tried to store the session data in a SQL Server database, but I quickly discovered that I can’t create the needed database on my shared server because I only have one database in my package. Also, there is no guarantee that the rest of the script would have been able to run.
My questions: is there any other way to get around this problem? Should I buy another database only for this? Is there another type of session that I could use? Is there anything else I can use instead of session to keep track of my user when they are connected on my website?
I’m really open for any type of solution! Thanks a lot!
ASP.NET allows you to specify how you want the Session management handled.
As you’ve discovered you can use SqlServer mode – but this doesn’t have to point to a separate database, it can use the same database that you already have.
There are also separate third party packages for managing web farm sessions, but you probably don’t want the expense (and probably won’t be able to install a package like this) for the setup you have.