.NETGURU
Session vars verse cache
Messages   Related Types
This message was discovered on ASPFriends.com 'aspngcache' list.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.

sanderson@calibresys.com
Are people still using session variables to hold information specific to a
user. I'm just starting to build out the user access for a site. I built a
User Object and thought I would put it in cashe until the information is
needed. Seems the Cache is more like an Application variable. Each user
that got into the system overwrote the pervious object. Was wondering what
other people are doing?

Reply to this message...
 
    
Skowronski, Thomas
You need to be aware that the framework may remove items from the cache at
any time with no warning. If you are expecting something to be there you
must explicitly perform a check to be sure it is still there prior to using
it.

Example:

If (IsNothing(Cache(key))) Then
    'Do something here to update the cache
    UpdateCache(key)
End If

Tom Skowronski

-----Original Message-----
From: Click here to reveal e-mail address [mailto:Click here to reveal e-mail address]
Sent: Thursday, December 13, 2001 4:11 PM
To: aspngcache
Subject: [aspngcache] Session vars verse cache

Are people still using session variables to hold information specific to a
user. I'm just starting to build out the user access for a site. I built a
User Object and thought I would put it in cashe until the information is
needed. Seems the Cache is more like an Application variable. Each user
that got into the system overwrote the pervious object. Was wondering what
other people are doing?

| [aspngcache] member Click here to reveal e-mail address = YOUR ID
| http://www.aspfriends.com/aspfriends/aspngcache.asp = JOIN/QUIT

Reply to this message...
 
    
Andy Smith (VIP)
as far as I know, there is still only session and cookies for
long-time-frame persistance.
to me, the cache is just another look at Application variables, with
the neat feature that they expire on their own according to rules.

my general rule of thumb...
if it's security-minded, put it in the session
if it's preference-minded, put it in a cookie

A bit off-topic now...

What I think would be great is a User object which had an Item
dictionary where you could tell it the security level required for the
item, or something to that effect.

So you could just do something like

thisUser["DatabaseClearance"] = new UserData( authorizedClearance,
UserData.SecurityLevel.High );
thisUser["BackgroundColor"] = new UserData( chosenColor,
UserData.SecurityLevel.Low );

the effect would be that High levels would be put in the session, and
low levels would go to a cookie. but all that would be transparent to
the developer.

>>> Click here to reveal e-mail address 12/13/01 02:11PM >>>
Are people still using session variables to hold information specific
to a
user. I'm just starting to build out the user access for a site. I
built a
User Object and thought I would put it in cashe until the information
is
needed. Seems the Cache is more like an Application variable. Each
user
that got into the system overwrote the pervious object. Was wondering
what
other people are doing?

| [aspngcache] member Click here to reveal e-mail address = YOUR ID
| http://www.aspfriends.com/aspfriends/aspngcache.asp = JOIN/QUIT

Reply to this message...
 
    
Ahmed, Salman
How do you ensure that when the session is gone, so are the cookies?
Sure u can first check for the session , if no session kill all cookies..but
what if your on a page where you are only checking for cookies?

-----Original Message-----
From: Andy Smith [mailto:Click here to reveal e-mail address]
Sent: Thursday, December 13, 2001 4:42 PM
To: aspngcache
Subject: [aspngcache] Re: Session vars verse cache

as far as I know, there is still only session and cookies for
long-time-frame persistance.
to me, the cache is just another look at Application variables, with
the neat feature that they expire on their own according to rules.

my general rule of thumb...
if it's security-minded, put it in the session
if it's preference-minded, put it in a cookie

A bit off-topic now...

What I think would be great is a User object which had an Item
dictionary where you could tell it the security level required for the
item, or something to that effect.

So you could just do something like

thisUser["DatabaseClearance"] = new UserData( authorizedClearance,
UserData.SecurityLevel.High );
thisUser["BackgroundColor"] = new UserData( chosenColor,
UserData.SecurityLevel.Low );

the effect would be that High levels would be put in the session, and
low levels would go to a cookie. but all that would be transparent to
the developer.

>>> Click here to reveal e-mail address 12/13/01 02:11PM >>>
Are people still using session variables to hold information specific
to a
user. I'm just starting to build out the user access for a site. I
built a
User Object and thought I would put it in cashe until the information
is
needed. Seems the Cache is more like an Application variable. Each
user
that got into the system overwrote the pervious object. Was wondering
what
other people are doing?

| [aspngcache] member Click here to reveal e-mail address = YOUR ID
| http://www.aspfriends.com/aspfriends/aspngcache.asp = JOIN/QUIT

| [aspngcache] member Click here to reveal e-mail address = YOUR ID
| http://www.aspfriends.com/aspfriends/aspngcache.asp = JOIN/QUIT

Reply to this message...
 
 




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification