PDA

Click to See Complete Forum and Search --> : Best way to keep data across asp.net pages


lleemon
May 26th, 2004, 08:58 AM
Looking for the best way to store data across the site while a user is signed in using asp.net

I have read so far that cookies probably are not the best due to browser issues. I also have seen that session variables will work but could chew up a lot of memory. Also see with asp.net we have caching available and thought I could cache data from a database after user was authorized so on each page we have this info. Issue with caching is if the server needs memory it could take this info if set at low priority.
Then I go back to keeping just my key value for the user in a session value and then on page_load query the db to get the required data for his account on each page.

Any experts out there have the professional way of doing his?

Thanks in advance.

Lethal
May 26th, 2004, 11:05 AM
This is exactly what Session State is utilized for. In reality, if you are developing a production application, your web server will most likely have enough fire power to handle the load. Also, the asp.net caching mechanism is very powerful and useful for storing things that are not user specific (although it can be). Just dont fall into the trap of dumping everything into session/cache.

nemaroller
May 27th, 2004, 01:26 PM
You probably have seen all the warnings about throwing too much info into Session, of course, no one can quantifiably say what is too much.

That really depends on how many concurrent sessions you may have on a system at one, and how much data you are storing for each session. And of course, the server itself.

If you only expect 10-20 concurrent sessions, you can obviously store far more data. If you expect 250 concurrent sessions, well, you have to be careful.