Re: Session state is not available in this context

From: Joe Kaplan \(MVP - ADSI\) (joseph.e.kaplan_at_removethis.accenture.com)
Date: 03/31/04


Date: Tue, 30 Mar 2004 22:58:08 -0600

The cache is application scope, so you need to share it with all concurrent
users. This is generally easy to do with cache keys that include the a
unique identifier for the user.

The cache can last as long as you want, depending on the expiration info you
provide when you put something in the cache.

One thing the cache can't do is out of process or SQL-based state
persistence. Those features of session state give you the ability to share
state between multiple load-balanced servers and survive work process
restarts since the state is persisted externally.

A lot of the time, the cache will do what you want and is faster, but it
depends. There are lots of good articles around that discuss the various
ASP.NET state management options.

Joe K.

"A.M" <IHateSpam@sapm123.com> wrote in message
news:ubgH2rlFEHA.3132@TK2MSFTNGP12.phx.gbl...
> Thank you for reply.
>
> Is the Cache's scope at application level or session level ? Does it keep
> data for all session long? If it is so, generally why would I use Session
> object if i have Cache object?
>
> Thanks
> Ali
>
> "[MSFT]" <lukezhan@online.microsoft.com> wrote in message
> news:zuH0$DjFEHA.3568@cpmsftngxa06.phx.gbl...
> > Hi Ali,
> >
> > AuthenticateRequest event is raised right after a user has been
> > authenticated but still has not been authorized meaning that aplication
> has
> > not decided on the areas that this user can have access to. And this
> stage,
> > application hasn't acquired the state also. So there is no session state
> at
> > this point. You can use the Cache object as Joe suggest.
> >
> > Regards,
> >
> > Luke
> > Microsoft Online Support
> >
> > Get Secure! www.microsoft.com/security
> > (This posting is provided "AS IS", with no warranties, and confers no
> > rights.)
> >
>
>



Relevant Pages

  • Re: How best to use php5 objects between pages?
    ... > or cache storage (PHP-APC cache can provide this, ... 1.He can use APC cache instead of dealing shared memory by himself. ... session files or databases. ... Session files are relatively secure. ...
    (comp.lang.php)
  • Re: Avoiding generating redo logs
    ... a query is executed which ... We store the results in the "cache" and then the ... outside of the session (as ours is a web app over http a new session is ... regard to this specific question regqarding NOLOGGING ...
    (comp.databases.oracle.server)
  • Re: [PHP] A no brainer...
    ... *nothing* for purposes of session storage. ... Check out the query cache in the MySQL 5.0 manual, ... Max cache hits for any single cache entry depend on the number ...
    (php.general)
  • Re: public static/shared read only properties in global.asax
    ... I am trying to simplify the use of the Session, Application and Cache ... Most of our developers are just breaking ... >> Public Shared ReadOnly Property TitleAs String ...
    (microsoft.public.dotnet.framework)
  • Re: Store Asyncresult to session with sessionState mode = "SQLServer"
    ... A new Session may get the same SessionID again (because when a Session ... Cache items may get removed from the Cache automaticly. ... avoid the unnessersary overhead of the Cache Object because you do not need ... you just want to store a Object-Reference within memory. ...
    (microsoft.public.dotnet.framework.remoting)