473,324 Members | 2,456 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.

Session Timeout problem

Hi all,

How can I set the session TimeOut from inside the Code? Also is there a
way to make the session variables Expires after a number of minutes of
inactivity. i.e. I want to make the session variables expires after the
user stays inactive for 20 minutes. I am using ASP.net 2.

Thanks in advance

Nov 27 '06 #1
3 2172
20 minutes is the default session time out and it is set in the
configuration. You could code your own session timeout behaviour in
application_beginrequest (in global.asax) by holding time of last post in the
session, then one next request for the session, if that var is more than 20
minutes ago, cal Session.Clear or Session.Abandon (abandon destorys the whole
session and generates a new sessionid)

HTH

Ciaran O'Donnell
http://wannabedeveloper.spaces.live.com

"metsie" wrote:
Hi all,

How can I set the session TimeOut from inside the Code? Also is there a
way to make the session variables Expires after a number of minutes of
inactivity. i.e. I want to make the session variables expires after the
user stays inactive for 20 minutes. I am using ASP.net 2.

Thanks in advance

Nov 27 '06 #2
I don't know that you can dynamically set the session TimeOut value for
each session - that is a machine.config or web.config variable...

Am I to understand you correctly that you want to be able to destroy
the session variables after the TimeOut period passes, but keep the
session alive?

Thanks for clarification...

On Nov 27, 11:20 am, "metsie" <lamees.af...@dashsoft.comwrote:
Hi all,

How can I set the session TimeOut from inside the Code? Also is there a
way to make the session variables Expires after a number of minutes of
inactivity. i.e. I want to make the session variables expires after the
user stays inactive for 20 minutes. I am using ASP.net 2.

Thanks in advance
Nov 27 '06 #3
re:
>I don't know that you can dynamically set the session TimeOut value for
each session - that is a machine.config or web.config variable...
You can...

Sub Page_Load(Sender As Object, E As EventArgs)
Session.Timeout = 30
End Sub

That will set the session timeout to 30 minutes, even if it's set to 20 minutes in web.config.

..

Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"Greg9Strat" <gr********@gmail.comwrote in message
news:11**********************@j44g2000cwa.googlegr oups.com...
>I don't know that you can dynamically set the session TimeOut value for
each session - that is a machine.config or web.config variable...

Am I to understand you correctly that you want to be able to destroy
the session variables after the TimeOut period passes, but keep the
session alive?

Thanks for clarification...

On Nov 27, 11:20 am, "metsie" <lamees.af...@dashsoft.comwrote:
>Hi all,

How can I set the session TimeOut from inside the Code? Also is there a
way to make the session variables Expires after a number of minutes of
inactivity. i.e. I want to make the session variables expires after the
user stays inactive for 20 minutes. I am using ASP.net 2.

Thanks in advance

Nov 27 '06 #4

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

Similar topics

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...
5
by: fbwhite | last post by:
I know this issue has been brought up many times, but I have tried many of the solutions to no avail. I wanted to give my specific case to see if someone could be of any help. We are using the...
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...
2
by: Rajesh.jain25 | last post by:
Hi, I am facing a problem of automatic session timeout problem and automatic session_end event fired. Case1: As I have analyzed I get to know that the default session timeout is 20 in...
2
by: Tomas Martinez | last post by:
Hi, Well, my problem is so simple as it says in the subjet but very frustrating also. I have a project and it is losing the session variables with each postback, so I downloaded from the web a...
2
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...
4
by: thig95 | last post by:
Hi, I've got a web application written in ASP class with VBScript. We have a home grown conctact management system for my company that our users stay active in throughout the day. My problem lies...
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: 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
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
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...
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)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
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

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.