473,506 Members | 17,100 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

problem with expired session

Hi
I have some data driven pages with a datagrid set to allow paging. This is
working fine, the only problem is if a user left the browser at such page,
and after the session expired the user click on the page number again, this
will trigger a postback but some of the required session variable has been
destroyed along with the cookie (I guess), then an error of "Null Object
reference" will be thrown!!

What is the best way to prevent such error, please?!
Would it be enough to just check User.Identity.IsAuthenticated ?

TIA
--

Nov 19 '05 #1
1 980
You should code defensively -- check for null (or Nothing) and if you code
can't continue processing then do a Response.Redirect to a page where the
user can start all over again.

-Brock
DevelopMentor
http://staff.develop.com/ballen
Hi
I have some data driven pages with a datagrid set to allow paging.
This is
working fine, the only problem is if a user left the browser at such
page,
and after the session expired the user click on the page number again,
this
will trigger a postback but some of the required session variable has
been
destroyed along with the cookie (I guess), then an error of "Null
Object
reference" will be thrown!!
What is the best way to prevent such error, please?! Would it be
enough to just check User.Identity.IsAuthenticated ?

TIA


Nov 19 '05 #2

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

Similar topics

9
2622
by: Bartosz Wegrzyn | last post by:
I need help with sessions. I createt set of web site for nav with authorization. first I go into main.php which looks like this: <?php //common functions include_once '../login/common.php';...
6
2532
by: Keith | last post by:
Is there any way of detecting whether a session variable does not exist because it expired or because it simply did not exist in the first place? Thanks
3
1319
by: Grant | last post by:
We have over 130 new users that signed on within 3 weeks. Once in a great while we get email from some user who cannot create account successfully. Here is the scenario New user will...
5
649
by: Uzi Baruch | last post by:
Hi! Is there an embedded way to check if a session ends? i have an standard ASP.NET application and i want to check if the session has expired on every "Click" that the user did, and...
3
7376
by: Simon | last post by:
Hi all, Any help with this would be much appreciated: I have a site where the session needs to timeout because of security concerns. I want to send the user back to the login page if the...
6
3317
by: NH | last post by:
How can I warn a user that their session has expired when they click on a button etc?
17
4948
by: Riaan | last post by:
Hi guys! I have an issue that needs urgent resolution. Imagine this scenario: You have: 1 production server running Windows Server 2003, IIS6 and an instance of MSDE 2000. There is an...
5
6706
by: news.microsoft.com | last post by:
We are logging many events on our application but cant seem to discover how to determine who the user was in the session end event, as any session storage seems to have disapeared at the point at...
3
1539
by: Steph | last post by:
Hi, I am a programmer and I have a question about a ASP.NET peace of code. I have a program that has a session timeout of 2 minutes configured in Web.config file: <sessionState...
4
2423
by: sriram | last post by:
Hello Friends, I am new to this group so big HIIIIIIII to all :) fine i have a serious doubt about session handling in PHP. After 20 min (default time) session getting expired, session values...
0
7105
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
7308
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,...
1
7023
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...
0
7479
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...
0
5617
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5037
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3188
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...
0
3178
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1534
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 ...

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.