How to check session timeout value in asp.net

Posted by Allemahesh under ASP.NET on 7/15/2013 | Points: 10 | Views : 3298 | Status : [Member] [MVP] | Replies : 4
I have an web application. I have set the session time out to 10 min from c# code. Now I want to extended this time out when 10 min is ruched. How to check if session time out is riches at 10 min in asp.net.




Responses

Posted by: Ssj_Kumar on: 7/15/2013 [Member] Starter | Points: 25

Up
0
Down
var balanceTime =parseInt(Session.Timeout)-parseInt(System.Configuration.ConfigurationSettings.AppSettings
["SessionWarning"].ToString());

Now you can check with balanceTime which hold the balance expire time data

Regards,
Jayakumar Selvakani

Allemahesh, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Allemahesh on: 7/15/2013 [Member] [MVP] Silver | Points: 25

Up
0
Down
No it is not working. The Session.Timeout is always showing 20. Can you help me.

Allemahesh, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: aswinialuri-19361 on: 7/15/2013 [Member] Starter | Points: 25

Up
0
Down
hi,

try this i hope it might be useful to you
In web config file:
<sessionState mode="InProc" cookieless="true" timeout="10"></sessionState>
inglobal.asax file:


void Session_Start(object sender, EventArgs e)
{
Session.Timeout = 15;
}
and checkk it

If you've a page active, doing background work with a timer, then the session won't expire. It's only if there's no activity will expiry take place.


Mark as Answer if it helps you
Thanks&Regards
Aswini Aluri

Allemahesh, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Allemahesh on: 7/15/2013 [Member] [MVP] Silver | Points: 25

Up
0
Down
No, the above code is not help full. My question is how to check the reaming timeout for current session. Please help me.

Allemahesh, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response