<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Codelab Blog &#187; VB.NET</title>
	<atom:link href="http://blog.codelab.co.nz/tag/vb-net/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.codelab.co.nz</link>
	<description>Technical Articles and News from Codelab Ltd</description>
	<lastBuildDate>Tue, 17 Jan 2012 13:10:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Detect when a session has ended ASP.NET</title>
		<link>http://blog.codelab.co.nz/2010/06/30/detect-when-session-ended/</link>
		<comments>http://blog.codelab.co.nz/2010/06/30/detect-when-session-ended/#comments</comments>
		<pubDate>Wed, 30 Jun 2010 03:32:02 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[.NET Framework]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Visual Basic]]></category>
		<category><![CDATA[VB.NET]]></category>

		<guid isPermaLink="false">http://blog.codelab.co.nz/?p=259</guid>
		<description><![CDATA[A problem that I have had in the past is trying to find out when a session has expired within ASP.NET and how to deal with the expired session.   One solution is to add the following code into the Page_Init event.   You can add this event into a class that inherits the Page class so [...]]]></description>
			<content:encoded><![CDATA[<p>A problem that I have had in the past is trying to find out when a session has expired within ASP.NET and how to deal with the expired session.   One solution is to add the following code into the Page_Init event.   You can add this event into a class that inherits the Page class so that you can reuse on more than one page or all pages if needed.</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">If Not Context.Session Is Nothing Then<br />
If Session.IsNewSession Then<br />
Dim szCookieHeader As String = Request.Headers(&quot;Cookie&quot;)<br />
If Not String.IsNullOrEmpty(szCookieHeader) And szCookieHeader.IndexOf(&quot;ASP.NET_SessionId&quot;) &amp;gt;= 0 Then<br />
Response.Redirect(&quot;/sessiontimeoutpage.aspx&quot;)<br />
End If<br />
End If<br />
End If</div></div>
<p>This code checks if a new session has been created and if the header has a ASP.NET Session id.   This makes sure that we are checking for a session that has just been created.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.codelab.co.nz/2010/06/30/detect-when-session-ended/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

