2.0: Cache vs Session

R

RAM

Hello,
I am learning .NET, ASP.NET 2.0. I would like to ask you a question: when to
use Cache["x"], when to use Session["x"]? If I have multiuser application
can I use Cache["x"] to keep some value separately for each user logged in?
Thank you.
/RAM/
 
G

Guest

Session is designed for user-specific items - things that pertain to the
current user of your app only.

Cache is for more general items that would apply to all users of your app.
Cache also offers more expiration options and callbacks as well.
Peter
 
K

Kumar Reddi

Cache is normally used to store items accessed across the application.
i.e; across multiple sessions.. But where as the Session is used to
store the session specific data.

For your question, the answer is NO, the value of Cache["x"], will be
same across different sessions
 

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

Members online

No members online now.

Forum statistics

Threads
473,787
Messages
2,569,627
Members
45,329
Latest member
InezZ76898

Latest Threads

Top