<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>State Management</title><link>http://forums.asp.net/22.aspx</link><description>Managing ASP.NET state - ViewState, Application, Session, etc. &lt;a href="http://aspadvice.com/SignUp/list.aspx?l=69&amp;c=17" target="_blank"&gt;Email List&lt;/a&gt;</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Re: Session timeout</title><link>http://forums.asp.net/thread/3278435.aspx</link><pubDate>Tue, 07 Jul 2009 08:29:51 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3278435</guid><dc:creator>sirdneo</dc:creator><author>sirdneo</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3278435.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=22&amp;PostID=3278435</wfw:commentRss><description>&lt;p&gt;There are a lot of reasons for session loss. To name a few,&lt;br /&gt;&lt;br /&gt;1-&amp;nbsp; Application Pool is recycled. - We will know this looking at the system logs&lt;br /&gt;2-&amp;nbsp; IIS/worker process is restarted. - System logs will tell this as well&lt;br /&gt;3-&amp;nbsp; Application Domain is restarted. - We need to monitor for application restarts for the ASP.NET counter in perfmon to check this. &lt;br /&gt;&lt;br /&gt;Few reasons for application restarts include&lt;br /&gt;1- Bin folder of the application is touched by some application (Might Be antivirus)&lt;br /&gt;2- Web.config or the machine.config is touched (Might Be antivirus)&lt;br /&gt;3- Global.asax file is touched (Might Be antivirus)&lt;br /&gt;4- Antivirus is running&lt;br /&gt;5- Something in the code is causing session loss, it can be anything. You will need to look into the code to have a fix on this.&lt;br /&gt;6- Any Other thing :(&lt;br /&gt;&lt;br /&gt;If all mentioned above did not help you then it might be due to anti virus software. Software scans the files in application folder and updates their date/time. Which causes IIS to restart. There fore uninstall the anti virus from server. However, if you exclude the application folder from virus scan that will also do the job. Also you need to remove .config,.aspx,.ascs and other extensions specific to your application for further security.&lt;/p&gt;</description></item><item><title>Re: Session timeout</title><link>http://forums.asp.net/thread/3274251.aspx</link><pubDate>Sat, 04 Jul 2009 04:51:53 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3274251</guid><dc:creator>sureshmdb</dc:creator><author>sureshmdb</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3274251.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=22&amp;PostID=3274251</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;Hi Lasar,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;So many&amp;nbsp;causes for Session Timeout,some of them you checked in web.config file and coding part.Is it working fine in your local system(ie in local system you didn&amp;#39;t face the session out problem) then it means Serverpeople are restricted to your application due to causes fo logfiles so you clear the log files of SQL server&lt;/p&gt;</description></item><item><title>Re: Session timeout</title><link>http://forums.asp.net/thread/3273521.aspx</link><pubDate>Fri, 03 Jul 2009 12:42:44 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3273521</guid><dc:creator>SSA</dc:creator><author>SSA</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3273521.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=22&amp;PostID=3273521</wfw:commentRss><description>&lt;p&gt;Hi Lasar,&lt;/p&gt;&lt;p&gt;&lt;a href="http://forums.asp.net/p/1350386/2755959.aspx"&gt;http://forums.asp.net/p/1350386/2755959.aspx&lt;/a&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;This explains why it expires, but I would like to know are you using login web control? I had the same problem.&lt;/p&gt;&lt;p&gt;then try this:&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div style="position:absolute;left:-10000px;top:0px;width:1px;height:1px;overflow-x:hidden;overflow-y:hidden;" id="_mcePaste"&gt;&amp;lt;authentication mode=&amp;quot;Forms&amp;quot;&amp;gt;&lt;/div&gt;
&lt;div style="position:absolute;left:-10000px;top:0px;width:1px;height:1px;overflow-x:hidden;overflow-y:hidden;" id="_mcePaste"&gt;&lt;span style="white-space:pre;"&gt;			&lt;/span&gt;&amp;lt;forms loginUrl=&amp;quot;~/Modules/Authentication/Login.aspx&amp;quot; protection=&amp;quot;All&amp;quot; timeout=&amp;quot;30&amp;quot; name=&amp;quot;.ShopperASPXAUTH&amp;quot; path=&amp;quot;~&amp;quot; requireSSL=&amp;quot;false&amp;quot; slidingExpiration=&amp;quot;true&amp;quot; defaultUrl=&amp;quot;default.aspx&amp;quot; cookieless=&amp;quot;UseDeviceProfile&amp;quot; enableCrossAppRedirects=&amp;quot;false&amp;quot;/&amp;gt;&lt;/div&gt;
&lt;div style="position:absolute;left:-10000px;top:0px;width:1px;height:1px;overflow-x:hidden;overflow-y:hidden;" id="_mcePaste"&gt;&lt;span style="white-space:pre;"&gt;		&lt;/span&gt;&amp;lt;/authentication&amp;gt;&lt;/div&gt;&lt;p&gt;&lt;p&gt;&amp;lt;authentication mode=&amp;quot;Forms&amp;quot;&amp;gt;&lt;/p&gt;&lt;p&gt;&lt;span class="Apple-tab-span" style="white-space:pre;"&gt;			&lt;/span&gt;&amp;lt;forms loginUrl=&amp;quot;~/Modules/Authentication/Login.aspx&amp;quot; protection=&amp;quot;All&amp;quot; timeout=&amp;quot;30&amp;quot; name=&amp;quot;.ASPXAUTH&amp;quot; path=&amp;quot;~&amp;quot; requireSSL=&amp;quot;false&amp;quot; slidingExpiration=&amp;quot;true&amp;quot; defaultUrl=&amp;quot;default.aspx&amp;quot; cookieless=&amp;quot;UseDeviceProfile&amp;quot; enableCrossAppRedirects=&amp;quot;false&amp;quot;/&amp;gt;&lt;/p&gt;&lt;p&gt;&amp;lt;/authentication&amp;gt;&lt;/p&gt;&lt;p&gt;Note there is seperate setting on IIS for session timeout.&lt;/p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;</description></item><item><title>Re: Session timeout</title><link>http://forums.asp.net/thread/3273420.aspx</link><pubDate>Fri, 03 Jul 2009 11:41:03 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3273420</guid><dc:creator>avicool08</dc:creator><author>avicool08</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3273420.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=22&amp;PostID=3273420</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;ok now,&lt;/p&gt;
&lt;p&gt;May be this is hapening because of internal error occured in your project....&lt;/p&gt;
&lt;p&gt;In my website(not DNN), what i did is I wrote a application_error event, which will fire, if any where in the project error occurs and write to a log file, and here is the code below, try to handel the error....(not sure about the code will be same in DNN or not, just check once)&lt;/p&gt;&lt;pre class="c-sharp" name="code"&gt;void Application_Error(object sender, EventArgs e) 
    {

        // Code that runs when an unhandled error occurs
        try
        {


            //if (Server.GetLastError().GetType() == typeof(HttpException))
            //{
            if (!Server.GetLastError().Message.Trim().Contains(&amp;quot;File does not exist.&amp;quot;))
            {
                Session[&amp;quot;UserID&amp;quot;] = null;
                Session.Abandon();
                Session.Clear();
                Response.Expires = 0;
                Response.Cache.SetNoStore();
                Response.AppendHeader(&amp;quot;Pragma&amp;quot;, &amp;quot;no-cache&amp;quot;);
                Response.Clear();

                HttpApplication app = (HttpApplication)sender;
                HttpContext context = app.Context;
                Exception ex = context.Server.GetLastError().GetBaseException();
                context.Response.Clear();
                ExceptionUtility.LogException(ex, &amp;quot;Global.asax&amp;quot;, &amp;quot;Application_Error&amp;quot;);
            }
            //}

        }
        catch (Exception ex)
        {
            string strErro = ex.Message;
        }
    }&lt;/pre&gt;
&lt;p&gt;&lt;br /&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Session timeout</title><link>http://forums.asp.net/thread/3273287.aspx</link><pubDate>Fri, 03 Jul 2009 10:24:32 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3273287</guid><dc:creator>Lasar</dc:creator><author>Lasar</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3273287.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=22&amp;PostID=3273287</wfw:commentRss><description>&lt;p&gt;I am developing a site in DNN&amp;nbsp;platform. In my site(as shopping cart), I am using 
session.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; But, I am loosing my session within 2 to 3 minutes. I have made 
neccessary changes in my web config.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Code I added in web config.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;sessionState &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
mode=&amp;quot;InProc&amp;quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; stateNetworkTimeout=&amp;quot;10000&amp;quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; 
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; stateConnectionString=&amp;quot;tcpip=127.0.0.1:42424&amp;quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&amp;nbsp; sqlConnectionString=&amp;quot;data 
source=127.0.0.1;Trusted_Connection=yes&amp;quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
cookieless=&amp;quot;false&amp;quot; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; timeout=&amp;quot;10000&amp;quot; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&amp;nbsp; /&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; I want my session to be alive for more than 45 to 60 minutes.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Is any thing want to add in the web config.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Please help me.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Thank 
You..........&lt;/p&gt;</description></item></channel></rss>