473,386 Members | 1,715 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Session TimeOut

I am wanting to find out a way to timeout my session
This issue is that the user retrieve data from a datatable and that data get stale over time, so after 20 minutes, I want to be able to tell the user that their session has timed out and they will need to refresh their data

I set the session time out in the web config file to 20 minutes, but this does not seems to have no effect. The user is still able to retrieve data and leave that data on the screen for hours and then provide an update to that data

How do I cause a session timeout? Do I just create a session variable and check for it presense everytime and if it is not present, then I know I have a time out?
Nov 18 '05 #1
3 2096
The usual way to kill a session is Session.Abandon. Is that what you meant?

"Jim Heavey" <an*******@discussions.microsoft.com> wrote in message
news:AD**********************************@microsof t.com...
I am wanting to find out a way to timeout my session.
This issue is that the user retrieve data from a datatable and that data
get stale over time, so after 20 minutes, I want to be able to tell the
user that their session has timed out and they will need to refresh their
data.

I set the session time out in the web config file to 20 minutes, but this
does not seems to have no effect. The user is still able to retrieve data
and leave that data on the screen for hours and then provide an update to
that data.

How do I cause a session timeout? Do I just create a session variable and
check for it presense everytime and if it is not present, then I know I
have a time out?


Nov 18 '05 #2
Why not use the built in Cache Object. Read the "Caching Application Data" topic from MSDN (ms-help://MS.VSCC.2003/MS.MSDNQTR.2003FEB.1033/cpguide/html/cpconcacheapis.htm).

This also has a callback through the CacheItemRemovedCallback Delegate so that you can recreate the data. Remember that this is shared across application and you should create your own logic for each user. Quite simple

On the other hand if you still prefer to use the Session Object then you need to provide more informaiton as to the Events where the Data is being recreated and populated

Regards

Trevor Benedict R
Nov 18 '05 #3

"Jim Heavey" <an*******@discussions.microsoft.com> wrote in message news:AD**********************************@microsof t.com...
I am wanting to find out a way to timeout my session.
This issue is that the user retrieve data from a datatable and that data get stale over time, so after 20 minutes, I want to be able to tell the user that their session has timed out and they will need to refresh their data.
I set the session time out in the web config file to 20 minutes, but this does not seems to have no effect. The user is still able to retrieve data and leave that data on the screen for hours and then provide an update to that data.
How do I cause a session timeout? Do I just create a session variable and check for it presense everytime and if it is not

present, then I know I have a time out?

"session timeout" is a server-side thing. When a response has been given (a page
has been sent to the browser), then the server is done with it and can't change it.
When the (server side) session times out, all session variables are removed for
this particular session, freeing resources.
By the way, the timeout is reset on every request so it is not 20 minutes after the
first request but after the latest request.

When you want to do something about reacting to stale data, you could do this:
a) check the session, if it is new (specific stored items are missing) then a timeout
has occurred. Forget the posted data and show an error message.
b) use a meta-refresh tag to redirect (client-side) to some other page after a timeout.

Hans Kesting
Nov 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: Geigho | last post by:
Setting session timeout in web.config file does not seem to have any effect. Any explanation or suggestion will be appreciated.
4
by: DavidS | last post by:
First: There are several ways to confuse one regarding session timeout. (1) web.config - <sessionState timeout="20"> (2) IIS Manager | Internet Information Services | ServerNode | Default Web Site...
8
by: Joe Abou Jaoude | last post by:
hi, I have a web app with forms authentication and a timeout session of 20 mins for security reasons. I recently added a feature that allows users (if they want to) to automatically log in...
11
by: Vishal | last post by:
Hello, can anybody tell me how I can extend the session expiry time? Is it done via code or via IIS? Sorry I am new and dont know about this.
5
by: Just D. | last post by:
Do we have any access to the Session object from a different Session? The idea is to save Session of a current user and then if he logs in again then return the Session back. It's not a problem to...
8
by: bdeviled | last post by:
I am deploying to a web environment that uses load balancing and to insure that sessions persist across servers, the environment uses SQL to manage sessions. The machine.config file determines how...
17
by: jensen bredal | last post by:
Hello, i'm struggling with a somehow badly understood session scenario. I provide acces to my pages based on form authentication using Session cookies. Som of my pages are supposed to be...
4
by: UJ | last post by:
I have a page where the user can upload a video file. As you can guess, this may take a while. Is there a way I can change the session timeout for just this one page? I would also want to change...
25
by: =?Utf-8?B?RGF2aWQgVGhpZWxlbg==?= | last post by:
I tried: <sessionState timeout="1"> </sessionState> bounced IIS, and after 1 minute still had a session. ??? -- thanks - dave
6
by: ChrisAtWokingham | last post by:
I have been struggling with unexpected error messages on an ASP.NET system, using SQL and C#. The application draws organisation charts, based on data stored in the SQL database. Some of the chart...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
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,...
0
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...
0
jinu1996
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...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.