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 4 1659
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" <te**@test.co m> wrote in message
news:uF******** ******@TK2MSFTN GP10.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
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" <je******@hotma il.com> wrote in message
news:OJ******** ******@TK2MSFTN GP12.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" <te**@test.co m> wrote in message news:uF******** ******@TK2MSFTN GP10.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
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" <te**@test.co m> wrote in message
news:u4******** ******@tk2msftn gp13.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" <je******@hotma il.com> wrote in message news:OJ******** ******@TK2MSFTN GP12.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" <te**@test.co m> wrote in message news:uF******** ******@TK2MSFTN GP10.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
"Jerry III" <je******@hotma il.com> wrote in
news:eT******** ******@TK2MSFTN GP10.phx.gbl: 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
True - but when you use the session object in ASP.net, it does have an
expiration. And if you know the user is done you should use its Abandon
method.
--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
"Programmin g is an art form that fights back" This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Stanley |
last post by:
has anyone managed to use cache application block in a web application?
thanks
stanley
|
by: Jim Douglas |
last post by:
Ok, I'm must be an dummy, there are tons of examples which none of which I
can get to work! I want to setup and refresh about (10) different cache
items. Most examples show this type of work being completed in the
global.asax but I can't get it to work. I move the code to a C# class, call
it from a webpage and it works fine. Am I trying to...
|
by: napawlm |
last post by:
Is there a way to "pass" an XMLHttpRequest object to the callback
function for onreadystatechange? Or a way to access it from
onreadystatechange? I would like to avoid the use of a global
variable...
Example:
/* How do I get rid of this global variable? */
xmlHttp = new XMLHttpRequest();
|
by: Lokkju |
last post by:
I am pretty much lost here - I am trying to create a managed c++
wrapper for this dll, so that I can use it from c#/vb.net, however, it
does not conform to any standard style of coding I have seen. It is
almost like it is trying to implement it's own COM interfaces...
below is the header, and a link to the dll+code:
Zip file with header,...
|
by: eyoung |
last post by:
I call a function that takes the unit price and quantity ordered to
create an amount...it looks something like this.
function calculateCost()
{
quantity=document.RFO.quantity.value;
unitPrice=document.RFO.unitPrice.value;
total=0;
if(isPositiveInteger(quantity))
{
| |
by: Daniel Rucareanu |
last post by:
I have the following script:
function Test(){}
Test.F = function(){}
Test.F.FF = function(){}
Test.F.FF.FFF = function(){}
Test.F.FF.FFF.FFFF = function(){}
//var alias = function(){};
var alias = Test.F.FF.FFF.FFFF;
|
by: an |
last post by:
I've implemented a call-back function
to repopulate the stored Cache objects
when they expires or are removed
it works great
but
in one situation only it doesen't work
(that is the callback is not fired):
when,
|
by: smmk25 |
last post by:
Before I state the problem, I just want to let the readers know, I am
knew to C++\CLI and interop so please forgive any newbie questions.
I have a huge C library which I want to be able to use in a .NET
application and thus am looking into writing a managed C++ wrapper for
in vs2005. Furthermore, this library has many callback hooks which...
|
by: dizzy |
last post by:
Hi
I wonder if this code is standard conformant and should work on all
conformant implementations (for some type T):
1: void* mem = ::operator new(sizeof(T));
2: T* p = new(mem) T(args...);
3: delete p;
line 2 I know it should be fine because global operator new should return
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it. ...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |