Managing Session State

 Hi,

 

Is there a way to set how long a session variable persists before it is destroyed?  I use forms based authentication on my site, but some events are based on particular session variables, and often times the session variable will be destroyed if the user leaves the session idle for a few minutes.  Can I configure my site so that session variables stick around until the forms authentication session is over?  Or, is it possible to set an event that triggers when the session state expires or when the session variables are destroyed that redirects to the login page?

 

 

0
ppalubinski
4/7/2009 7:49:00 PM
asp.net.state-management 8807 articles. 0 followers. Follow

3 Replies
1646 Views

Similar Articles

[PageSpeed] 18
Get it on Google Play
Get it on Apple App Store

you can set the session timout in web.config. <sessionState timeout="15"/> the value is in minutes, so its 15 min.

OR you can also clear the session state when redirects to logout or any other page by calling Session.Clear() function.

0
dgupta
4/7/2009 8:23:34 PM

ppalubinski:
Can I configure my site so that session variables stick around until the forms authentication session is over? 

Make sure authentication timeout and session timeout values are same in webconfig.. 

<sessionState cookieless="UseDeviceProfile" timeout="40" />

<authentication mode="Forms">

 <forms name="MyAuthCookie" loginUrl="login.aspx" defaultUrl="Default.aspx" 
    timeout="40" slidingExpiration="true" 
    cookieless="UseDeviceProfile" path="/" protection="All" />

</authentication>

 Also check session timeout value in IIS.



My Blog


"Don't be afraid to be wrong; otherwise you'll never be right."
0
budugu
4/7/2009 9:06:25 PM

 Thanks everyone!  Looks like that did the trick.  I appreciate your help.

0
ppalubinski
4/7/2009 9:18:48 PM
Reply:

Web resources about - Managing Session State - asp.net.state-management

Managing editor - Wikipedia, the free encyclopedia
A managing editor is a senior member of a publication 's management team. In the United States , a managing editor oversees and coordinates ...

Facebook EMEA Director Christian Hernandez Joins White Star Capital As Managing Partner
... in a post on his Facebook page that he was leaving the social network to join early-stage venture-capital firm White Star Capital as a managing ...

Upgraded Tools for Creating and Managing Facebook Ads
The updated versions of Power Editor and Ads Manager make it easier to create, edit and track Facebook ads. See the new tools.

Facebook SPMD SHIFT Kate Burns as Managing Director of Europe
... Facebook Strategic Preferred Marketing Developer, announced Wednesday that it has hired former AOL Europe CEO Kate Burns as the company’s Managing ...

Cravings - Meet your daily calorie goals by managing your craving and by making healthy food choices ...
Get Cravings - Meet your daily calorie goals by managing your craving and by making healthy food choices. Engage in a social experience with ...

Managing the Bailout, 12 February 2009
rappaportcenter's Managing the Bailout, 12 February 2009 set

Google I/O 2011: Managing and visualizing your geospatial data with Fusion Tables - YouTube
Kathryn Hurley, James McGill, Simon Rogers Geospatial data has special requirements that aren't met by traditional database or cloud data storage. ...

Cisco A/NZ appoints Boal as managing director
Cisco A/NZ appoints Boal as managing director ARNnet The appointment comes in the wake of previous managing director, Richard Kitts, moving ...

Fiat Chrysler bid to seize assets of former managing director Clyde Campbell
... and misusing more than $30 million in company money. Fiat Chrysler Australia is seeking to freeze the assets of former Australian managing director ...

Managing executive pay (04:31)
Asciano chairman and BHP Billiton director Malcolm Broomhead says the reward structure for executives needs to be simplified as boards come to ...

Resources last updated: 12/1/2015 3:08:55 PM