473,769 Members | 4,202 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Session Timeout isn't working correctly.

Folks,
I'm having problems with my session timeout. People using my website leave
it just sitting there while they do other things. They have logged in (
using Forms Authentication ) and will be doing other things will a page of
mine is up on the screen. But the session times out so that when I try and
use a session variable, it crashes saying Object reference not set to an
instance of an object.

So I put
<sessionState timeout="4800" />

in my web.config (I know it's ridicously long....)

I went in to IIS and changed the Session timeout to 720.

I stopped IIS and restarted it.

I verified the setting in Session Timeout.

I put on my page a print of the session timeout and it shows 4800.

But people are still getting the error after 30 minutes.

What am I missing? Do I want to disable Session State?

TIA - Jeff.
Jun 27 '08 #1
3 2731
Option 1: Set up a redirect on the page a minute or two less than session
timeout. Redirect to logout.aspx and abandon the session there. Then, a user
that walks away is logged out and cannot get the ASPX error. On the logout
page have the message: "you have been logged out due to a timeout in your
session, click here to log in again". Or you can duplicate the login box on
that screen. Your choice.

If you choose this option, you should also disable the back button. The
easiest way is to set up JavaScript that pushes the person forward one page
in history, so they are always on the page ahead of the page they are on.

<script language="javas cript">
window.history. forward(1);
</script>

Option 2: Set up a friendly error page that says something like:

There was an error in the application. One of the most common reasons is you
were an idiot and walked away while you were filling out a form. If this is
you, click here to log in again.

Yes, the message was a joke, but you should get the idea. :-)

I would try option 1 first. It is friendlier and th

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

Subscribe to my blog
http://gregorybeamer.spaces.live.com/lists/feed.rss

or just read it:
http://gregorybeamer.spaces.live.com/

*************** *************** **************
| Think outside the box! |
*************** *************** **************
"Mufasa" <jb@nowhere.com wrote in message
news:%2******** ********@TK2MSF TNGP05.phx.gbl. ..
Folks,
I'm having problems with my session timeout. People using my website leave
it just sitting there while they do other things. They have logged in (
using Forms Authentication ) and will be doing other things will a page of
mine is up on the screen. But the session times out so that when I try and
use a session variable, it crashes saying Object reference not set to an
instance of an object.

So I put
<sessionState timeout="4800" />

in my web.config (I know it's ridicously long....)

I went in to IIS and changed the Session timeout to 720.

I stopped IIS and restarted it.

I verified the setting in Session Timeout.

I put on my page a print of the session timeout and it shows 4800.

But people are still getting the error after 30 minutes.

What am I missing? Do I want to disable Session State?

TIA - Jeff.

Jun 27 '08 #2
Your missing the point. I want to make the session last longer.

I already have it where if the session times out it goes to the login page.
I want the session to last longer.

J.

"Cowboy (Gregory A. Beamer)" <No************ @comcast.netNoS pamMwrote in
message news:CC******** *************** ***********@mic rosoft.com...
Option 1: Set up a redirect on the page a minute or two less than session
timeout. Redirect to logout.aspx and abandon the session there. Then, a
user that walks away is logged out and cannot get the ASPX error. On the
logout page have the message: "you have been logged out due to a timeout
in your session, click here to log in again". Or you can duplicate the
login box on that screen. Your choice.

If you choose this option, you should also disable the back button. The
easiest way is to set up JavaScript that pushes the person forward one
page in history, so they are always on the page ahead of the page they are
on.

<script language="javas cript">
window.history. forward(1);
</script>

Option 2: Set up a friendly error page that says something like:

There was an error in the application. One of the most common reasons is
you were an idiot and walked away while you were filling out a form. If
this is you, click here to log in again.

Yes, the message was a joke, but you should get the idea. :-)

I would try option 1 first. It is friendlier and th

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

Subscribe to my blog
http://gregorybeamer.spaces.live.com/lists/feed.rss

or just read it:
http://gregorybeamer.spaces.live.com/

*************** *************** **************
| Think outside the box! |
*************** *************** **************
"Mufasa" <jb@nowhere.com wrote in message
news:%2******** ********@TK2MSF TNGP05.phx.gbl. ..
>Folks,
I'm having problems with my session timeout. People using my website
leave it just sitting there while they do other things. They have logged
in ( using Forms Authentication ) and will be doing other things will a
page of mine is up on the screen. But the session times out so that when
I try and use a session variable, it crashes saying Object reference not
set to an instance of an object.

So I put
<sessionStat e timeout="4800" />

in my web.config (I know it's ridicously long....)

I went in to IIS and changed the Session timeout to 720.

I stopped IIS and restarted it.

I verified the setting in Session Timeout.

I put on my page a print of the session timeout and it shows 4800.

But people are still getting the error after 30 minutes.

What am I missing? Do I want to disable Session State?

TIA - Jeff.


Jun 27 '08 #3
asp.net has an idle timeout. if the site is not used in the timeout (usually
20 minutes) then it cycles down losing session. you can increase the idle
timeout with iis under app pool settings.

you should also handle a lost session with code, as there can be many causes
of a recycle.
-- bruce (sqlwork.com)
"Mufasa" wrote:
Folks,
I'm having problems with my session timeout. People using my website leave
it just sitting there while they do other things. They have logged in (
using Forms Authentication ) and will be doing other things will a page of
mine is up on the screen. But the session times out so that when I try and
use a session variable, it crashes saying Object reference not set to an
instance of an object.

So I put
<sessionState timeout="4800" />

in my web.config (I know it's ridicously long....)

I went in to IIS and changed the Session timeout to 720.

I stopped IIS and restarted it.

I verified the setting in Session Timeout.

I put on my page a print of the session timeout and it shows 4800.

But people are still getting the error after 30 minutes.

What am I missing? Do I want to disable Session State?

TIA - Jeff.
Jun 27 '08 #4

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

Similar topics

3
2807
by: Craig Storey | last post by:
I have a form where users logged in using sessions can edit articles in a WYSIWYG editor. Some of them take their time and don't like to save their work very often and occassionally the sessions expire and their work goes poof. (I've suggested editing off-line and simply copy+paste but they prefer the editor.) After a lot of searching I've found the main culprit is session.gc_maxlifetime and I can set it longet like... ...
17
5216
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 running continuously and refreshing once an hour. I there set timeout= 61 in <sessionState section and on my page it says <meta http-equiv="refresh" content="3600">. I also set timeout=120 in the <forms section of web.config to make sure
15
10993
by: dee | last post by:
Hi, What is the maximum number of minutes for Session timeout that I can specify in web.config? Thanks. Dee
3
7738
by: charliewest | last post by:
Hi - I'm trying to control the error that is thrown when the session times out. My code is as follows: <customErrors mode="RemoteOnly"> <error redirect="includes/reload.aspx?iOP=1" statusCode="Timeout" />
2
4914
by: Aryan | last post by:
Hi, I have put my session related parameter in web.config under system.web, given below is the code for same. <system.web> <sessionState timeout ="1440" mode ="InProc" /> </system.web> this session timeout is not working out, as this shows me login page again if i dont do something for more then 20 minutes.
25
6101
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
2
1747
by: Orgil | last post by:
I'm using ASP 3.0 however there is ASP.NET, because I'm working an old site that is built in ASP 3.0. I hope you for getting any help for my problem from you. So, my site's sessions are empty before its timeout. I have searched and checked for long time around this problem, but I can't fix the problem yet. The session timeout is 20 minutes in IIS 5.1 by default. I didn't set the timeout as "session.timeout=10" in codes of VBScript
3
590
by: trullock | last post by:
Hi, I want to test some session timeout code ive written but im getting a few problems. I want to reduce the session timeout to 1min so i dont have to wait around for 20 min to see if my code is working. Quite simply, how do i do this? I want the session to behave exactly as it does normally (is that
6
3782
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 editing processes place a very heavy load on the server as the effects of the edit ripple through the organisation structure, requiring potentially large numbers of rows in one of the tables to be updated. (I have done it this way to make the more...
0
9589
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, 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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10219
Oralloy
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9998
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
9865
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6675
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5310
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3967
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
2
3567
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.