i am new to asp.net..please help me to write code for setting session timeout and how to implement in all pages,i tried out using web config method,but not getting,i am nearing to deadline. This is my code
Asked
Active
Viewed 320 times
0
-
Where is the code, what did you try and what do you meand "but not getting"? Have you activated session state at all? The default timeout is 20 minutes, so you should be able to read anything you store in Session state for at least 20 minutes. If you can't either your code is wrong or you haven't activated Session state at all. – Panagiotis Kanavos Jul 31 '13 at 08:31
-
possible duplicate of [Session timeout in ASP.NET](http://stackoverflow.com/questions/648992/session-timeout-in-asp-net) – Panagiotis Kanavos Jul 31 '13 at 08:32
-
add timeout=2000 in connection string. – Janki Jul 31 '13 at 08:45
2 Answers
2
From code:
Session.Timeout = 60; // this will set 60 min timout
From config:
<sessionState timeout="60" />

Vano Maisuradze
- 5,829
- 6
- 45
- 73
1
Using Web.config
<sessionState
timeout="number of minutes"............
Full reference HERE !
or
Using Forms authentication
<system.web>
<authentication mode="Forms">
<forms timeout="50"/>
</authentication>
<sessionState timeout="60" />
</system.web>

zey
- 5,939
- 14
- 56
- 110
-
thanks..but i have one more doubt...will it be applicable to all pages,shall i need to do any coding for aspx.cs pages..reply please – user2637192 Aug 01 '13 at 08:19