ASP.NET sql sessions

Hi Guys,

Does anyone here use the sqlserver mode for session state? Wondered if it is possible to use it in a shared hosting environment?

Cheers.
 
Yes they will work, there is some MS technet article on using them, I will try to dig it up after I have had some rest if someone does not beat me to it.
 
Hi Stephen,

I found some instructions, but the install script seems to want to install a couple of stored procs in the master db. I know some other shared hosting offer ASP.NET sql server session usage. I wondered if you guys need to do anything before I can use it.

Any help would be appreciated.

Cheers.

PS. Hi Antic, yes, it is simply a way of storing the session data in a sql db rather than inprocess looked after by IIS or the state server.
 
I can add something if I need, but I really thought it could be modified form their sql script toa userlevel as well.
 
Why would you want to do that?
Do you have a web farm ?
if no then session state to sql is completly pointless and bad programming.
 
Spikeman,

Professional programmers would begto differ, SQL is the best session method, the other methods are too dependent upon the memoryon the server, the processes on the server, and other users on the server.
 
It depends entirely upon your requirements. InProc Session state in ASP.NET works using an internal memory based list object. Everytime something gets added to the state it gets added to the Session state of this list. Because it is memory based it is fully dependent on the lifetime of the AppDomain that your Web application runs in.

There are several reasons why the AppDomain may be recycled, all of which I would like NOT to affect active sessions within my application.

On top of this I wish to store a few sizeable serialised objects in my sessions and this would be very inneficient via Inproc.

If building robust and scalable applications is bad programming then I am certainly guilty :)
 
oh oh, it's one of those techie relative opinion arguments. :)

Actually I have to ask why you want to use a session like that, whether inproc or sql, instead of using stateless sessions - a single cookie for the session guid, and session data stored in the sql db. Isn't that supposed to be the most scalable solution?
 
Isn't that what you'll get effectively when you use sql server for session state?

antic said:
oh oh, it's one of those techie relative opinion arguments. :)

Actually I have to ask why you want to use a session like that, whether inproc or sql, instead of using stateless sessions - a single cookie for the session guid, and session data stored in the sql db. Isn't that supposed to be the most scalable solution?
 
LOL, well it was a good excuse to post that instructional Flash movie.. hope you got something out of it. :)
 
According to "ASP.NET Developers Cookbook" (excellent bed-time reading by the way) it says..."To set up SQL Server to store session info, you must run the InstallSqlState.sql file located in %SYSTEMROOT%\Microsoft.NET\Framework\version\ on the SQL Server."
 
Back
Top