473,324 Members | 2,531 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,324 software developers and data experts.

Logout when Session Expires

my problem is that after every 20minutes i got the error that the
Object reference not set to an instance of an object.
and highlight the line
lblWelcome.Text = "Welcome, " + Session["userName"].ToString();

I want that when the session expires either user will see LogIn page or the sesion resume their values.
Where i write the code for the above.... thanks for your code in advance
Feb 18 '08 #1
4 2002
kunal pawar
297 100+
Before use session checked that exists or not if not then redirect ur page to Login page

if Session["userName"] == null then response.redirect('');
Feb 18 '08 #2
Before use session checked that exists or not if not then redirect ur page to Login page

if Session["userName"] == null then response.redirect('');

I have to record the logout time also. bt this code will not work it only to redirect to another page. becoze when the session expires then how i got the value that which user is logged in n how we record their time of logout in database
Feb 19 '08 #3
kunal pawar
297 100+
Oh, then u need to maintain USer session in cookies or in hidden variable. that will help u to know which user's session expired
Feb 19 '08 #4
Oh, then u need to maintain USer session in cookies or in hidden variable. that will help u to know which user's session expired
Thanks i had done that by storing the value in hidden field.

Thanks once again
Feb 19 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: JessyEzzy | last post by:
I am working on this site in which users have to login first to access the site pages, after a user performs a login a record for this user is inserted in a table of online users. When a user...
1
by: mubarak basha | last post by:
hi friends, i have created session using login details successfully...now i have a doubt that is how can i logout the page....once i logout the page then that previous page cannot be...
25
by: crescent_au | last post by:
Hi all, I've written a login/logout code. It does what it's supposed to do but the problem is when I logout and press browser's back button (in Firefox), I get to the last login page. In IE,...
1
by: shrik | last post by:
hi everybody. I have following problem. There are two pages. index.jsp and main.jsp in my application Index.jsp contains logging interface in . It submits password and userid to loginform bean. ...
1
by: Kandiman | last post by:
Hiya, i made a asp page, and one of my divs (as a include) is as below. the problem is if the main page is resubmitted, i get logged out again?... heres the code.. i think its on the value=true...
6
by: Thiago Macedo | last post by:
I could not find on the web a complete solution for this task. This is not the perfect solution, because it's doesn't have the ability to log the logout if browser crash or user leave it open while...
10
by: DavidPr | last post by:
When I logout as one user and log in under a different user, it opens with the last user's information. User 1 - Unsername: Davey Jones User 2 - Unsername: David Smith I log out from Davey...
2
by: phpmagesh | last post by:
Hi to all, I have created a page with login and logout. i used session to register the login user and when he clicks in logout, it will destroy the session. this is nice but if system is...
5
by: vinodsk101 | last post by:
Hi all, I am developing a web application. I am using Servlet and JSP. After logout the user should not able to see the previous pages and page should navigate to loginpage.jsp. I have used...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.