2

I am developing movie ticket booking website. I am using sessions in that i want to extend the session timeout now am using 20mins as session timeout but when the user follows through the payment gateway or when he is in payment gateway page. the session timeout should not execute is there anyway to do that or session timeout should be extended . can it be possible through the global.asax page or is there is any other way

Thanks in advance

Tajkumar
  • 317
  • 2
  • 5
  • 16
  • Are you trying to extend the session timeout globally? – ekad Jan 22 '14 at 05:07
  • yes i want to extend the session timeout globally is there any other way to extend the session timeout i don't know the ways to extend – Tajkumar Jan 22 '14 at 05:12

4 Answers4

2

you can adjust the application pool in the IIS process on the server where your application is hosted. By default it is set to 20 minutes. you can adjust it as per your convenience.

You can refer this Link

Shashank
  • 401
  • 2
  • 13
  • 1
    i am not asking about setting session timeout i want to extend the session timeout is there any way – Tajkumar Jan 22 '14 at 06:07
1

In web.config.

 <system.web>
<compilation debug="true" targetFramework="4.0" />
<sessionState timeout="10"></sessionState>
<httpRuntime executionTimeout="9999" maxRequestLength="10240"/>
 .....
</system.web> 

It will set session time to 10 minutes

In Global.asax file we can set session timeout in Session_Start event like this

 void Session_Start(object sender, EventArgs e)
 {
  // Code that runs when a new session is started
 Session.Timeout = 15;
 }

Add this lines of code for a particular session that you log in.

Shreyas Achar
  • 1,407
  • 5
  • 36
  • 63
  • 1
    i want to extend the sesion timeout not to set the timeout – Tajkumar Jan 22 '14 at 05:18
  • If you want to extended you can change in the web.config right,by the way why you want to extend? and how much time u want to extend? – Shreyas Achar Jan 22 '14 at 05:22
  • 1
    as i explained if the user is in payment gateway page and session timeout is about to expire then i want to extend or when user wants to extend his session timeout – Tajkumar Jan 22 '14 at 05:24
0

You can have "sliding" session timeout, which will cover your scenario. Here is an example of doing it.

How to do both sliding and absolute timeout in asp.net forms authentication

Hope this helps.

Community
  • 1
  • 1
Aby
  • 1,916
  • 1
  • 12
  • 18
0

I've implemented this solution on a few websites where we track online learning visitors/duration on a course. It prompts them when session is about to expire, and gives them 1 minute to click and preserve the session, else the pop up remains, but the expiration has passed and the session is dead. Great for people expiring at their computer b/c the popup grabs their attentions.

It also lets them know they have expired if they walked away, and are not expecting to be still logged in when they come back.

http://www.experts-exchange.com/Programming/Languages/Scripting/ASP/Q_21208651.html

ransems
  • 641
  • 7
  • 19