ASP.Net w/ c# behind: Store data in cookie or retrieve from datastore?

J

James Geurts

This is probably more of an ASP.Net situation rather than
c#, but since all of my code behind is in c#, maybe it
fits here. I'm wondering, generally, at what point is it
too inefficient to store information in a client cookie
rather than retrieve it from a datastore.

Now, I see the advantage of not storing it in a cookie,
but a lot of programs already use cookies to store things
from user credentials (roles) to specific user settings.
Now I know that part of the dilemma is how much data
needs to be stored/retrieved. So I would like to know in
general situations. A better question would probably
be "How do you determine where to store information for
the current user/session?" The options as I see it:

System cache
Datastore (SQL, Access, Xml)
User cookie

I would just think that storing information in a cookie
would actually take longer to retrieve and process than
just making a request to a datastore. Any opinions
welcome?
 
J

Jeffrey Tan[MSFT]

Hi James,

Thanks for posting in this group.
Based on my understanding, you want some information on state management in
asp.net and your concern also focus on the performance.
Actually, asp.net introduces many ways of state management: Session, Cache,
ViewState, Cookie etc
The article below talks about the State Management in ASP.NET:
http://www.fawcette.com/vsm/2003_10/magazine/columns/aspnet/default_pf.aspx

For performance information in asp.net, please refer to the link below:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/htm
l/cpconDevelopingHigh-PerformanceASPNETApplications.asp

Hope it helps,

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
J

James Geurts

Thanks Jeffrey,

It seems that those articles contain what I was looking
for and more. If I have problems/questions I'll raise
them here again.

Jim
 
J

Jeffrey Tan[MSFT]

Hi James,

Thanks for your feedback.
I am glad that it makes sense to you. Please feel free.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top