468,119 Members | 1,988 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,119 developers. It's quick & easy.

Session Variables

I have my session timeout at 20 minutes. Is there a way
to set session time per variable. For instance: I
create session("TEST") and I want it to expire in 2
minutes of no activity...Is that possible?

For Clarification:
If session time out in the web.config file is set to 20
minutes the session only times out if no activity occurs,
right!
Thanks
Nov 18 '05 #1
2 2967
Nope. Just clear this variable when it is no more needed ? Use a timestamp ?

What is scenario ?

--

"brian" <bs******@lbrspec.com> a écrit dans le message de
news:1b*****************************@phx.gbl...
I have my session timeout at 20 minutes. Is there a way
to set session time per variable. For instance: I
create session("TEST") and I want it to expire in 2
minutes of no activity...Is that possible?

For Clarification:
If session time out in the web.config file is set to 20
minutes the session only times out if no activity occurs,
right!
Thanks

Nov 18 '05 #2
I think you can consider the use of Cache class
Page.Cache.Insert("KEY", value, null, DateTime.Now.AddMinutes(2),
TimeSpan.Zero);
will insert a value that will expire in 2 minutes without sliding
expiration.
See System.Web.Caching.Cache class for more information about this.

I hope this helps

brian wrote:
I have my session timeout at 20 minutes. Is there a way
to set session time per variable. For instance: I
create session("TEST") and I want it to expire in 2
minutes of no activity...Is that possible?

For Clarification:
If session time out in the web.config file is set to 20
minutes the session only times out if no activity occurs,
right! Yes. If something happen the timeout is slided with another 20 minutes.


Thanks

Nov 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Lina Manjarres | last post: by
31 posts views Thread by Harry Simpson | last post: by
10 posts views Thread by tshad | last post: by
3 posts views Thread by Alan Wang | last post: by
3 posts views Thread by Phillip N Rounds | last post: by
26 posts views Thread by BillE | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.