Re: Using global callback function with cache object

From: Jerry III (jerryiii_at_hotmail.com)
Date: 02/17/04


Date: Mon, 16 Feb 2004 16:38:57 -0800

Since you're cross-posting this into the asp group I assume you're talking
about a web application. There is no such thing as logoff in a web
application, HTTP is a stateless protocol. You cannot logoff user at a
certain time since you, as a server, cannot do anything but react to users
requests. If the user does not send a request there's nothing you can do.

As for using the Cache object for this - why would you want to logoff users
when you run low on memory (because that's when the Cache will start
releasing objects no matter what their expiration time)? It makes absolutely
no sense to use Cache here (or think that you can control the client from a
web application).

Jerry

"NWx" <test@test.com> wrote in message
news:u4Rg2$N9DHA.4044@tk2msftngp13.phx.gbl...
> Hi,
>
> Thanks for reply
> Actually I used an approach like this, not with the cookie, but with a
cache
> object
> I created a cache object which stores the date/time when the user must be
> logged off
> In my header Custom control's Load event, I check that object against
> current datetime, and logoff when necessary.
>
> My thought about callback from cache was to logoff EXACTLY when time was
> expired (because with current approach, if user don't load another page
for
> a longer time, he won't be logged off)
>
> Regards
>
> "Jerry III" <jerryiii@hotmail.com> wrote in message
> news:OJCFCbM9DHA.1428@TK2MSFTNGP12.phx.gbl...
> > You're definitely trying to use the wrong tool. Just create an encrypted
> > cookie with the users expiration time and log them out once their time
> > expires. Forms authentication can do this for you automatically. Cache
is
> > not the right object to do this with (your object can get released at
any
> > time, if you understand how the Cache object works you would know that).
> >
> > Jerry
> >
> > "NWx" <test@test.com> wrote in message
> > news:uFb1IcJ9DHA.2432@TK2MSFTNGP10.phx.gbl...
> > > Hi,
> > >
> > > I' trying to implement a callback method when a cache object expires
> > > I want to do this to automatically logout user after a timeout (for
demo
> > > purposes)
> > >
> > > My thought is, when user logon, create a cache object which expires
> after,
> > > let's say, 15 minutes, and in that moment, to direct user to a page
> > telling
> > > the time to run demo app was expired.
> > >
> > > I found an example on how to do this, but it involves working on the
> same
> > > page, because the callback function is declared as private void in the
> > page
> > > who register the cache object.
> > >
> > > Can I do this, using a shared function instead a private one?
> > >
> > > What I want it to execute the callback method no matter what page user
> is
> > > in, when timeout expires.
> > >
> > > Regards
> > >
> > >
> >
> >
>
>



Relevant Pages

  • Interview Questions May 1st, 2006
    ... What's the difference between Cache object and application object? ... What are dependencies in cache and types of dependencies? ... 1000 Interview Questions for .NET and SQL Server ...
    (comp.programming)
  • Re: OutputCache?
    ... you tell it to cache. ... The Cache object also isn't guaranteed not to drop. ... DataSet gets created by explicitly retrieving the records from the DB ... will expire & a Label which displays from where the records are being ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: OutputCache?
    ... cache for X seconds, that could be one of the reasons why the code I ... Here I am adding a DataSet to the cache using the Cache object. ... DataSet gets created by explicitly retrieving the records from the DB ... will expire & a Label which displays from where the records are being ...
    (microsoft.public.dotnet.framework.aspnet)
  • singleton serialization and weblogic - help!
    ... I'm trying to serialize a singleton cache object we're using for our ... Basically I've written a jsp to get the current instance of the cache ...
    (comp.lang.java.programmer)
  • Re: Caching data in a web app
    ... You can also apply a callback to the cache object when it expires. ... can check your connection and if it's up, ...
    (microsoft.public.dotnet.framework.aspnet)

Quantcast