<?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 in Global.asax</title><link>http://forums.asp.net/thread/3273666.aspx</link><pubDate>Fri, 03 Jul 2009 14:24:15 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3273666</guid><dc:creator>deepthoughts</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3273666.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=22&amp;PostID=3273666</wfw:commentRss><description>&lt;p&gt;When session state is enabled (which by default is), each request for a page is checked for a SessionID value. This SessionID value is sent from the browser.&lt;/p&gt;
&lt;p&gt;If it is not found, then ASP.NET considers this request as a new Session and assigns the SessionID property a new unique value and sends it to the browser with thre Response.&lt;/p&gt;
&lt;p&gt;Where the browser keeps the SessionID? By default, its saved in &amp;quot;ASP.NET_SessionId&amp;quot; cookie. Although you can configure the application so that the SessionIDs are passed through URL and not from cookies (&amp;quot;cookieless&amp;quot; sessions).&lt;/p&gt;
&lt;p&gt;Please refer to the following link for more details.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ms178581.aspx"&gt;http://msdn.microsoft.com/en-us/library/ms178581.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Hope it helps.&lt;/p&gt;</description></item><item><title>Re: Session in Global.asax</title><link>http://forums.asp.net/thread/3273123.aspx</link><pubDate>Fri, 03 Jul 2009 09:06:12 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3273123</guid><dc:creator>thuyaaung7</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3273123.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=22&amp;PostID=3273123</wfw:commentRss><description>&lt;p&gt;Hi,&lt;br /&gt;&lt;br /&gt;First of all, Thank alot for all of your responses.&lt;br /&gt;&lt;br /&gt;My question was a bit unclear. &lt;/p&gt;&lt;p&gt;I&amp;#39;d like to know how and which method, asp.net used in global.asax to identify the request session is expired and where does it generate the new session ID.&lt;/p&gt;&lt;p&gt;And I also need to identify between the expired session and new user session.&lt;/p&gt;&lt;p&gt;I traced the global.asax and I found that session Id has been issue between PreSendRequestContent method and BeginRequest method.&lt;/p&gt;&lt;p&gt;I would like to know how it is issue and where it gets the session id from.&lt;/p&gt;&lt;p&gt;Thank you guys.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Session in Global.asax</title><link>http://forums.asp.net/thread/3272188.aspx</link><pubDate>Thu, 02 Jul 2009 20:01:23 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3272188</guid><dc:creator>deepthoughts</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3272188.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=22&amp;PostID=3272188</wfw:commentRss><description>&lt;p&gt;Hi!&lt;/p&gt;
&lt;p&gt;Please note that whenever a client accesses the web application, he is infact living in a session. Unless the session timeouts or you forcefully abandons it, it lives up with the client. &lt;/p&gt;
&lt;p&gt;Now we put up some key,value pairs in to the Session object for our own requirements.&lt;/p&gt;
&lt;p&gt;So, when a user with &amp;quot;expired&amp;quot; session comes, the web application is, infact, going to start a new session for the same guy. So the Session_Start event of global.asax will fire. So you can handle the logic in the global.asax page or you can put in checks in your pages like Session.IsNewSession to make sure that this request is coming from a client who is &lt;/p&gt;
&lt;p&gt;1.) Either new&lt;/p&gt;
&lt;p&gt;2.) Previously his session expired and is going to start a new session.&lt;/p&gt;
&lt;p&gt;Hope it helps.&lt;/p&gt;</description></item><item><title>Re: Session in Global.asax</title><link>http://forums.asp.net/thread/3272023.aspx</link><pubDate>Thu, 02 Jul 2009 18:22:54 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3272023</guid><dc:creator>budugu</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3272023.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=22&amp;PostID=3272023</wfw:commentRss><description>&lt;p&gt;&lt;span style="FONT-FAMILY:arial,helvetica,sans-serif;"&gt;In Page_Load, check &lt;span style="FONT-FAMILY:arial,helvetica,sans-serif;"&gt;&lt;em&gt;Session.IsNewSession &lt;/em&gt;value. If it&amp;#39;s true, then session is expired.&lt;/p&gt;&lt;pre class="c-sharp:nogutter" name="code"&gt;if (Session.IsNewSession)
Server.Transfer(&amp;quot;Login.aspx&amp;quot;);&lt;/pre&gt;
&lt;p&gt;&lt;br /&gt;And&amp;nbsp;also&amp;nbsp;read this..&lt;/p&gt;
&lt;p&gt;&lt;/span&gt;&lt;/span&gt;&lt;a href="http://aspalliance.com/520_Detecting_ASPNET_Session_Timeouts.all"&gt;http://aspalliance.com/520_Detecting_ASPNET_Session_Timeouts.all&lt;/a&gt;&lt;br /&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Session in Global.asax</title><link>http://forums.asp.net/thread/3271897.aspx</link><pubDate>Thu, 02 Jul 2009 17:12:34 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3271897</guid><dc:creator>srinivaskotra</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3271897.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=22&amp;PostID=3271897</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;Hi,&lt;/p&gt;
&lt;p&gt;override protected void OnInit(EventArgs e)&lt;br /&gt;{&lt;br /&gt;base.OnInit(e);&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;//check to see if the Session is null (doesnt exist)&lt;br /&gt;if (Context.Session != null)&lt;br /&gt;{&lt;br /&gt;//check the IsNewSession value, this will tell us if the session has been reset&lt;br /&gt;if (Session.IsNewSession)&lt;br /&gt;{&lt;br /&gt;//now we know it&amp;#39;s a new session, so we check to see if a cookie is present&lt;br /&gt;string cookie = Request.Headers[&amp;quot;Cookie&amp;quot;];&lt;br /&gt;//now we determine if there is a cookie does it contains what we&amp;#39;re looking for&lt;br /&gt;if ((null != cookie) &amp;amp;&amp;amp; (cookie.IndexOf(&amp;quot;ASP.NET_SessionId&amp;quot;) &amp;gt;= 0))&lt;br /&gt;{&lt;br /&gt;//since it&amp;#39;s a new session but a ASP.Net cookie exist we know&lt;br /&gt;//the session has expired so we need to redirect them&lt;br /&gt;Response.Redirect(&amp;quot;YourURL&amp;quot;);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;} &lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.dotnetspider.com/resources/15837-check-for-session-time-out.aspx"&gt;http://www.dotnetspider.com/resources/15837-check-for-session-time-out.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.bigresource.com/ASP-how-we-know-that-the-Session-is-expired-in-asp--ojnyxftS.html"&gt;http://www.bigresource.com/ASP-how-we-know-that-the-Session-is-expired-in-asp--ojnyxftS.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Thanks :)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Session in Global.asax</title><link>http://forums.asp.net/thread/3271650.aspx</link><pubDate>Thu, 02 Jul 2009 15:01:10 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3271650</guid><dc:creator>thuyaaung7</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3271650.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=22&amp;PostID=3271650</wfw:commentRss><description>&lt;p&gt;Hi All,&lt;/p&gt;&lt;p&gt;I have a question.&lt;/p&gt;&lt;p&gt;I need to know that when a request with expired session id come in to a web application, how does the asp.net know it is expired?&lt;/p&gt;&lt;p&gt;And in which method, it is being checked. &lt;br /&gt;&lt;/p&gt;</description></item></channel></rss>