<?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>Wizz's Coding Solutions &#187; ASP.NET</title>
	<atom:link href="http://rainstorms.me.uk/blog/tag/aspnet/feed/" rel="self" type="application/rss+xml" />
	<link>http://rainstorms.me.uk/blog</link>
	<description>Problems that I come across in day to day coding</description>
	<lastBuildDate>Tue, 07 Sep 2010 07:41:08 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>App_Offline.htm &#8211; ScottGu&#8217;s Blog</title>
		<link>http://rainstorms.me.uk/blog/2010/09/07/app_offline-htm-scottgus-blog/</link>
		<comments>http://rainstorms.me.uk/blog/2010/09/07/app_offline-htm-scottgus-blog/#comments</comments>
		<pubDate>Tue, 07 Sep 2010 07:41:08 +0000</pubDate>
		<dc:creator>wizzard</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[app_offline.htm]]></category>
		<category><![CDATA[ASP.NET]]></category>

		<guid isPermaLink="false">http://rainstorms.me.uk/blog/?p=344</guid>
		<description><![CDATA[I just had an interesting message when working on an ASP.NET 2.0 website &#8211; &#8220;This application is currently offline. To enable the application, remove the app_offline.htm file from the application root directory.&#8220; I&#8217;m not sure how this happened, but it looks like it may have something to do with this&#8230; App_Offline.htm &#8211; ScottGu&#8217;s Blog. Bookmark this [...]


No related posts.

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>I just had an interesting message when working on an ASP.NET 2.0 website &#8211; &#8220;<span style="font-family: 'Times New Roman'; line-height: normal; font-size: small;"><em>This application is currently offline. To enable the application, remove the app_offline.htm file from the application root directory.</em>&#8220;</span></p>
<p>I&#8217;m not sure how this happened, but it looks like it may have something to do with this&#8230; <a href="http://weblogs.asp.net/scottgu/archive/2005/10/06/426755.aspx">App_Offline.htm &#8211; ScottGu&#8217;s Blog</a>.</p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Bookmark this post</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2010%2F09%2F07%2Fapp_offline-htm-scottgus-blog%2F&amp;title=App_Offline.htm+%26%238211%3B+ScottGu%26%238217%3Bs+Blog" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2010%2F09%2F07%2Fapp_offline-htm-scottgus-blog%2F&amp;title=App_Offline.htm+%26%238211%3B+ScottGu%26%238217%3Bs+Blog" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.dotnetkicks.com/kick/?url=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2010%2F09%2F07%2Fapp_offline-htm-scottgus-blog%2F&amp;title=App_Offline.htm+%26%238211%3B+ScottGu%26%238217%3Bs+Blog" rel="nofollow" title="Add to&nbsp;DotNetKicks"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/dotnetkicks.png" title="Add to&nbsp;DotNetKicks" alt="Add to&nbsp;DotNetKicks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2010%2F09%2F07%2Fapp_offline-htm-scottgus-blog%2F" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://FriendSite.com/users/bookmarks/?u=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2010%2F09%2F07%2Fapp_offline-htm-scottgus-blog%2F&amp;t=App_Offline.htm+%26%238211%3B+ScottGu%26%238217%3Bs+Blog" rel="nofollow" title="Add to&nbsp;FriendSite"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/friendsite.png" title="Add to&nbsp;FriendSite" alt="Add to&nbsp;FriendSite" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2010%2F09%2F07%2Fapp_offline-htm-scottgus-blog%2F&amp;title=App_Offline.htm+%26%238211%3B+ScottGu%26%238217%3Bs+Blog" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2010%2F09%2F07%2Fapp_offline-htm-scottgus-blog%2F&amp;title=App_Offline.htm+%26%238211%3B+ScottGu%26%238217%3Bs+Blog" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2010%2F09%2F07%2Fapp_offline-htm-scottgus-blog%2F&amp;title=App_Offline.htm+%26%238211%3B+ScottGu%26%238217%3Bs+Blog" rel="nofollow" title="Add to&nbsp;Slashdot"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/slashdot.png" title="Add to&nbsp;Slashdot" alt="Add to&nbsp;Slashdot" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2010%2F09%2F07%2Fapp_offline-htm-scottgus-blog%2F&amp;title=App_Offline.htm+%26%238211%3B+ScottGu%26%238217%3Bs+Blog" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.shoutwire.com/?p=submit&amp;link=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2010%2F09%2F07%2Fapp_offline-htm-scottgus-blog%2F" rel="nofollow" title="Add to&nbsp;Shoutwire"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/shoutwire.png" title="Add to&nbsp;Shoutwire" alt="Add to&nbsp;Shoutwire" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2010%2F09%2F07%2Fapp_offline-htm-scottgus-blog%2F" rel="nofollow" title="Add to&nbsp;Technorati"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2010%2F09%2F07%2Fapp_offline-htm-scottgus-blog%2F&amp;t=App_Offline.htm+%26%238211%3B+ScottGu%26%238217%3Bs+Blog" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->


<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://rainstorms.me.uk/blog/2010/09/07/app_offline-htm-scottgus-blog/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting the ASP.NET Development Web Server to use a root path</title>
		<link>http://rainstorms.me.uk/blog/2009/07/10/getting-the-asp-net-development-web-server-to-use-a-root-path/</link>
		<comments>http://rainstorms.me.uk/blog/2009/07/10/getting-the-asp-net-development-web-server-to-use-a-root-path/#comments</comments>
		<pubDate>Fri, 10 Jul 2009 13:39:54 +0000</pubDate>
		<dc:creator>wizzard</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[.NET 2.0]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Root path]]></category>
		<category><![CDATA[Testing]]></category>
		<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[Workarounds]]></category>

		<guid isPermaLink="false">http://rainstorms.me.uk/blog/?p=261</guid>
		<description><![CDATA[ASP.NET 2.0 comes with a test webserver which can be run by simply pressing F5 in Visual Studio from a website project which is located on your PC.  The only problem is that for reasons best known to Microsoft, it launches with the site configured in a subfolder.  This isn&#8217;t always convenient, as you may [...]


No related posts.

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>ASP.NET 2.0 comes with a test webserver which can be run by simply pressing F5 in Visual Studio from a website project which is located on your PC.  The only problem is that for reasons best known to Microsoft, it launches with the site configured in a subfolder.  This isn&#8217;t always convenient, as you may have paths relative to the site root which prevent this being practical for testing.</p>
<p>In order to get around this problem, you need to take the following steps: -</p>
<p>First of all, configure Visual Studio so that you can launch the test server manually as follows: -</p>
<p>Under the Tools menu, select External Tools.<br />
Add a new entry<br />
Call it something like ASP.NET Development Server<br />
Command is <em>C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\WebDev.WebServer.EXE</em> (you may need to alter the path for your local machine)<br />
Arguments are <em>/port:80 /path:$(ProjectDir)</em> (note that you will need to leave a space on the end of this for it to work properly.  Also, you can change the port number if you wish)</p>
<p>Press OK.  You can now launch the development server from the new entry on your Tools menu.  This will show in your system tray.  You should probably remember to close it when you are done.</p>
<p>The next step is to configure your project to use the server.  Right click on your project and click Property Pages.  If an empty dialogue comes up, press cancel and repeat the process &#8211; it should work second time.  Under Start Options, select Use custom server and leave the Base URL blank.  You may wish to change the start action as well.</p>
<p>Once you are done, you can press F5 to start debugging.  Don&#8217;t forget that next time you open the project you will need to start the server from the tools menu before you start debugging again, otherwise it won&#8217;t work.</p>
<p>Also, bear in mind that if this is a copy of a remote site, things like database connection strings may need changing.  Don&#8217;t forget to be careful not to overwrite any settings when you copy back if that is the case!</p>
<p>If you do want to develop on a copy of the site, the Website menu has a useful option to Copy website.</p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Bookmark this post</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2009%2F07%2F10%2Fgetting-the-asp-net-development-web-server-to-use-a-root-path%2F&amp;title=Getting+the+ASP.NET+Development+Web+Server+to+use+a+root+path" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2009%2F07%2F10%2Fgetting-the-asp-net-development-web-server-to-use-a-root-path%2F&amp;title=Getting+the+ASP.NET+Development+Web+Server+to+use+a+root+path" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.dotnetkicks.com/kick/?url=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2009%2F07%2F10%2Fgetting-the-asp-net-development-web-server-to-use-a-root-path%2F&amp;title=Getting+the+ASP.NET+Development+Web+Server+to+use+a+root+path" rel="nofollow" title="Add to&nbsp;DotNetKicks"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/dotnetkicks.png" title="Add to&nbsp;DotNetKicks" alt="Add to&nbsp;DotNetKicks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2009%2F07%2F10%2Fgetting-the-asp-net-development-web-server-to-use-a-root-path%2F" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://FriendSite.com/users/bookmarks/?u=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2009%2F07%2F10%2Fgetting-the-asp-net-development-web-server-to-use-a-root-path%2F&amp;t=Getting+the+ASP.NET+Development+Web+Server+to+use+a+root+path" rel="nofollow" title="Add to&nbsp;FriendSite"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/friendsite.png" title="Add to&nbsp;FriendSite" alt="Add to&nbsp;FriendSite" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2009%2F07%2F10%2Fgetting-the-asp-net-development-web-server-to-use-a-root-path%2F&amp;title=Getting+the+ASP.NET+Development+Web+Server+to+use+a+root+path" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2009%2F07%2F10%2Fgetting-the-asp-net-development-web-server-to-use-a-root-path%2F&amp;title=Getting+the+ASP.NET+Development+Web+Server+to+use+a+root+path" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2009%2F07%2F10%2Fgetting-the-asp-net-development-web-server-to-use-a-root-path%2F&amp;title=Getting+the+ASP.NET+Development+Web+Server+to+use+a+root+path" rel="nofollow" title="Add to&nbsp;Slashdot"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/slashdot.png" title="Add to&nbsp;Slashdot" alt="Add to&nbsp;Slashdot" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2009%2F07%2F10%2Fgetting-the-asp-net-development-web-server-to-use-a-root-path%2F&amp;title=Getting+the+ASP.NET+Development+Web+Server+to+use+a+root+path" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.shoutwire.com/?p=submit&amp;link=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2009%2F07%2F10%2Fgetting-the-asp-net-development-web-server-to-use-a-root-path%2F" rel="nofollow" title="Add to&nbsp;Shoutwire"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/shoutwire.png" title="Add to&nbsp;Shoutwire" alt="Add to&nbsp;Shoutwire" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2009%2F07%2F10%2Fgetting-the-asp-net-development-web-server-to-use-a-root-path%2F" rel="nofollow" title="Add to&nbsp;Technorati"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2009%2F07%2F10%2Fgetting-the-asp-net-development-web-server-to-use-a-root-path%2F&amp;t=Getting+the+ASP.NET+Development+Web+Server+to+use+a+root+path" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->


<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://rainstorms.me.uk/blog/2009/07/10/getting-the-asp-net-development-web-server-to-use-a-root-path/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ASP.NET Sessions Part 6 &#8211; Abandoning a Session</title>
		<link>http://rainstorms.me.uk/blog/2009/03/13/aspnet-sessions-part-6-abandoning-a-session/</link>
		<comments>http://rainstorms.me.uk/blog/2009/03/13/aspnet-sessions-part-6-abandoning-a-session/#comments</comments>
		<pubDate>Fri, 13 Mar 2009 13:32:09 +0000</pubDate>
		<dc:creator>wizzard</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[Abandon]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[ASP.NET Sessions]]></category>
		<category><![CDATA[Session]]></category>
		<category><![CDATA[Sessions]]></category>
		<category><![CDATA[SessionState]]></category>
		<category><![CDATA[State]]></category>

		<guid isPermaLink="false">http://rainstorms.me.uk/blog/?p=118</guid>
		<description><![CDATA[This entry is part of a series, ASP.NET Sessions&#187; If you want to terminate your session and effectively wipe out all variables in it, call Session.Abandon().  Although you can reset your session variables back to Nothing, this will also notify ASP.NET to clear the session up and call the event handler in Global.asax to deal [...]


No related posts.

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<div class="hackadelic-series-info on-frontpage"><small>This entry is part of a series,  <a href="javascript:;" class="hackadelic-sliderButton"onclick="toggleSlider('#hackadelic-sliderPanel-2')" title="click to expand/collapse slider ASP.NET Sessions">ASP.NET Sessions&raquo;</a> <span class="hackadelic-sliderPanel concealed" id="hackadelic-sliderPanel-2"></span></small></div><p>If you want to terminate your session and effectively wipe out all variables in it, call Session.Abandon().  Although you can reset your session variables back to Nothing, this will also notify ASP.NET to clear the session up and call the event handler in Global.asax to deal with the session end (I think that this is the only way that this ever actually gets fired, but I could be wrong).</p>
<div id="hackadelic-sliderNote-2" class="concealed">Entries in this series:<ol><li><a href="http://rainstorms.me.uk/blog/2009/03/03/sessions-in-aspnet-part-1/">ASP.NET Sessions Part 1</a></li><li><a href="http://rainstorms.me.uk/blog/2009/03/04/sessions-in-aspnet-part-2-accessing-session-state-variable-data/">ASP.NET Sessions Part 2 - accessing session state variable data</a></li><li><a href="http://rainstorms.me.uk/blog/2009/03/09/aspnet-sessions-part-3-maintaining-the-session-data-across-multiple-requests/">ASP.NET Sessions Part 3 - Maintaining the Session Data Across Multiple Requests</a></li><li><a href="http://rainstorms.me.uk/blog/2009/03/11/aspnet-sessions-part-4-configuring-how-the-session-variable-data-is-stored-on-the-server/">ASP.NET Sessions Part 4 - Configuring how the Session Variable Data is Stored on the Server</a></li><li><a href="http://rainstorms.me.uk/blog/2009/03/12/aspnet-sessions-part-5-how-long-does-a-session-last/">ASP.NET Sessions Part 5 - How Long Does a Session Last?</a></li><li>ASP.NET Sessions Part 6 - Abandoning a Session</li></ol><span style="display: block; margin-top: 3px; font-size: 7px"><a href="http://hackadelic.com/solutions/wordpress/sliding-notes" title="Powered by Hackadelic Sliding Notes 1.6.4">Powered by Hackadelic Sliding Notes 1.6.4</a></span></div><!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Bookmark this post</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2009%2F03%2F13%2Faspnet-sessions-part-6-abandoning-a-session%2F&amp;title=ASP.NET+Sessions+Part+6+%26%238211%3B+Abandoning+a+Session" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2009%2F03%2F13%2Faspnet-sessions-part-6-abandoning-a-session%2F&amp;title=ASP.NET+Sessions+Part+6+%26%238211%3B+Abandoning+a+Session" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.dotnetkicks.com/kick/?url=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2009%2F03%2F13%2Faspnet-sessions-part-6-abandoning-a-session%2F&amp;title=ASP.NET+Sessions+Part+6+%26%238211%3B+Abandoning+a+Session" rel="nofollow" title="Add to&nbsp;DotNetKicks"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/dotnetkicks.png" title="Add to&nbsp;DotNetKicks" alt="Add to&nbsp;DotNetKicks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2009%2F03%2F13%2Faspnet-sessions-part-6-abandoning-a-session%2F" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://FriendSite.com/users/bookmarks/?u=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2009%2F03%2F13%2Faspnet-sessions-part-6-abandoning-a-session%2F&amp;t=ASP.NET+Sessions+Part+6+%26%238211%3B+Abandoning+a+Session" rel="nofollow" title="Add to&nbsp;FriendSite"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/friendsite.png" title="Add to&nbsp;FriendSite" alt="Add to&nbsp;FriendSite" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2009%2F03%2F13%2Faspnet-sessions-part-6-abandoning-a-session%2F&amp;title=ASP.NET+Sessions+Part+6+%26%238211%3B+Abandoning+a+Session" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2009%2F03%2F13%2Faspnet-sessions-part-6-abandoning-a-session%2F&amp;title=ASP.NET+Sessions+Part+6+%26%238211%3B+Abandoning+a+Session" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2009%2F03%2F13%2Faspnet-sessions-part-6-abandoning-a-session%2F&amp;title=ASP.NET+Sessions+Part+6+%26%238211%3B+Abandoning+a+Session" rel="nofollow" title="Add to&nbsp;Slashdot"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/slashdot.png" title="Add to&nbsp;Slashdot" alt="Add to&nbsp;Slashdot" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2009%2F03%2F13%2Faspnet-sessions-part-6-abandoning-a-session%2F&amp;title=ASP.NET+Sessions+Part+6+%26%238211%3B+Abandoning+a+Session" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.shoutwire.com/?p=submit&amp;link=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2009%2F03%2F13%2Faspnet-sessions-part-6-abandoning-a-session%2F" rel="nofollow" title="Add to&nbsp;Shoutwire"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/shoutwire.png" title="Add to&nbsp;Shoutwire" alt="Add to&nbsp;Shoutwire" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2009%2F03%2F13%2Faspnet-sessions-part-6-abandoning-a-session%2F" rel="nofollow" title="Add to&nbsp;Technorati"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2009%2F03%2F13%2Faspnet-sessions-part-6-abandoning-a-session%2F&amp;t=ASP.NET+Sessions+Part+6+%26%238211%3B+Abandoning+a+Session" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->


<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://rainstorms.me.uk/blog/2009/03/13/aspnet-sessions-part-6-abandoning-a-session/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ASP.NET Sessions Part 5 &#8211; How Long Does a Session Last?</title>
		<link>http://rainstorms.me.uk/blog/2009/03/12/aspnet-sessions-part-5-how-long-does-a-session-last/</link>
		<comments>http://rainstorms.me.uk/blog/2009/03/12/aspnet-sessions-part-5-how-long-does-a-session-last/#comments</comments>
		<pubDate>Thu, 12 Mar 2009 21:29:14 +0000</pubDate>
		<dc:creator>wizzard</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[ASP.NET Sessions]]></category>
		<category><![CDATA[Session]]></category>
		<category><![CDATA[Sessions]]></category>
		<category><![CDATA[SessionState]]></category>
		<category><![CDATA[State]]></category>
		<category><![CDATA[Time]]></category>
		<category><![CDATA[Timeout]]></category>

		<guid isPermaLink="false">http://rainstorms.me.uk/blog/?p=78</guid>
		<description><![CDATA[This entry is part of a series, ASP.NET Sessions&#187; Bearing in mind what I posted in earlier parts of this series of posts on sessions, you may find that other factors cut short your users&#8217; sessions &#8211; see the earlier posts about this. You can set the timeout of your sessions using the &#8220;timeout&#8221; attribute [...]


No related posts.

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<div class="hackadelic-series-info on-frontpage"><small>This entry is part of a series,  <a href="javascript:;" class="hackadelic-sliderButton"onclick="toggleSlider('#hackadelic-sliderPanel-4')" title="click to expand/collapse slider ASP.NET Sessions">ASP.NET Sessions&raquo;</a> <span class="hackadelic-sliderPanel concealed" id="hackadelic-sliderPanel-4"></span></small></div><p>Bearing in mind what I posted in earlier parts of this series of posts on sessions, you may find that other factors cut short your users&#8217; sessions &#8211; see the earlier posts about this.</p>
<p>You can set the timeout of your sessions using the &#8220;timeout&#8221; attribute of the &#8220;sessionState&#8221; element in web.config.  This is a value set in <span style="text-decoration: underline;">minutes</span>, and is the <span style="text-decoration: underline;">idle</span> time before a session expires.  That means that the time is measured from the last request (not sure if it is measured from when the request is started, completed or some random point in the middle).  It isn&#8217;t measured from the start of the session or anything. </p>
<p>The maximum value is 525,600, which is the number of minutes in a year (assuming it is a non-leap year).  This maximum value apparently only applies to the in process and state server modes (I&#8217;ll be amazed if anyone manages to keep a session going that long in either of these modes without dedicating a server to it!).  </p>
<p>The default value is 20 minutes.</p>
<p>Note that changing this has absolutely no effect on classic ASP sessions &#8211; they operate completely independently.  I&#8217;m pretty sure nothing in web.config will ever really affect them.</p>
<div id="hackadelic-sliderNote-4" class="concealed">Entries in this series:<ol><li><a href="http://rainstorms.me.uk/blog/2009/03/03/sessions-in-aspnet-part-1/">ASP.NET Sessions Part 1</a></li><li><a href="http://rainstorms.me.uk/blog/2009/03/04/sessions-in-aspnet-part-2-accessing-session-state-variable-data/">ASP.NET Sessions Part 2 - accessing session state variable data</a></li><li><a href="http://rainstorms.me.uk/blog/2009/03/09/aspnet-sessions-part-3-maintaining-the-session-data-across-multiple-requests/">ASP.NET Sessions Part 3 - Maintaining the Session Data Across Multiple Requests</a></li><li><a href="http://rainstorms.me.uk/blog/2009/03/11/aspnet-sessions-part-4-configuring-how-the-session-variable-data-is-stored-on-the-server/">ASP.NET Sessions Part 4 - Configuring how the Session Variable Data is Stored on the Server</a></li><li>ASP.NET Sessions Part 5 - How Long Does a Session Last?</li><li><a href="http://rainstorms.me.uk/blog/2009/03/13/aspnet-sessions-part-6-abandoning-a-session/">ASP.NET Sessions Part 6 - Abandoning a Session</a></li></ol><span style="display: block; margin-top: 3px; font-size: 7px"><a href="http://hackadelic.com/solutions/wordpress/sliding-notes" title="Powered by Hackadelic Sliding Notes 1.6.4">Powered by Hackadelic Sliding Notes 1.6.4</a></span></div><!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Bookmark this post</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2009%2F03%2F12%2Faspnet-sessions-part-5-how-long-does-a-session-last%2F&amp;title=ASP.NET+Sessions+Part+5+%26%238211%3B+How+Long+Does+a+Session+Last%3F" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2009%2F03%2F12%2Faspnet-sessions-part-5-how-long-does-a-session-last%2F&amp;title=ASP.NET+Sessions+Part+5+%26%238211%3B+How+Long+Does+a+Session+Last%3F" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.dotnetkicks.com/kick/?url=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2009%2F03%2F12%2Faspnet-sessions-part-5-how-long-does-a-session-last%2F&amp;title=ASP.NET+Sessions+Part+5+%26%238211%3B+How+Long+Does+a+Session+Last%3F" rel="nofollow" title="Add to&nbsp;DotNetKicks"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/dotnetkicks.png" title="Add to&nbsp;DotNetKicks" alt="Add to&nbsp;DotNetKicks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2009%2F03%2F12%2Faspnet-sessions-part-5-how-long-does-a-session-last%2F" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://FriendSite.com/users/bookmarks/?u=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2009%2F03%2F12%2Faspnet-sessions-part-5-how-long-does-a-session-last%2F&amp;t=ASP.NET+Sessions+Part+5+%26%238211%3B+How+Long+Does+a+Session+Last%3F" rel="nofollow" title="Add to&nbsp;FriendSite"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/friendsite.png" title="Add to&nbsp;FriendSite" alt="Add to&nbsp;FriendSite" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2009%2F03%2F12%2Faspnet-sessions-part-5-how-long-does-a-session-last%2F&amp;title=ASP.NET+Sessions+Part+5+%26%238211%3B+How+Long+Does+a+Session+Last%3F" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2009%2F03%2F12%2Faspnet-sessions-part-5-how-long-does-a-session-last%2F&amp;title=ASP.NET+Sessions+Part+5+%26%238211%3B+How+Long+Does+a+Session+Last%3F" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2009%2F03%2F12%2Faspnet-sessions-part-5-how-long-does-a-session-last%2F&amp;title=ASP.NET+Sessions+Part+5+%26%238211%3B+How+Long+Does+a+Session+Last%3F" rel="nofollow" title="Add to&nbsp;Slashdot"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/slashdot.png" title="Add to&nbsp;Slashdot" alt="Add to&nbsp;Slashdot" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2009%2F03%2F12%2Faspnet-sessions-part-5-how-long-does-a-session-last%2F&amp;title=ASP.NET+Sessions+Part+5+%26%238211%3B+How+Long+Does+a+Session+Last%3F" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.shoutwire.com/?p=submit&amp;link=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2009%2F03%2F12%2Faspnet-sessions-part-5-how-long-does-a-session-last%2F" rel="nofollow" title="Add to&nbsp;Shoutwire"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/shoutwire.png" title="Add to&nbsp;Shoutwire" alt="Add to&nbsp;Shoutwire" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2009%2F03%2F12%2Faspnet-sessions-part-5-how-long-does-a-session-last%2F" rel="nofollow" title="Add to&nbsp;Technorati"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2009%2F03%2F12%2Faspnet-sessions-part-5-how-long-does-a-session-last%2F&amp;t=ASP.NET+Sessions+Part+5+%26%238211%3B+How+Long+Does+a+Session+Last%3F" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->


<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://rainstorms.me.uk/blog/2009/03/12/aspnet-sessions-part-5-how-long-does-a-session-last/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ASP.NET Sessions Part 4 &#8211; Configuring how the Session Variable Data is Stored on the Server</title>
		<link>http://rainstorms.me.uk/blog/2009/03/11/aspnet-sessions-part-4-configuring-how-the-session-variable-data-is-stored-on-the-server/</link>
		<comments>http://rainstorms.me.uk/blog/2009/03/11/aspnet-sessions-part-4-configuring-how-the-session-variable-data-is-stored-on-the-server/#comments</comments>
		<pubDate>Wed, 11 Mar 2009 14:02:20 +0000</pubDate>
		<dc:creator>wizzard</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[ASP.NET Sessions]]></category>
		<category><![CDATA[Session]]></category>
		<category><![CDATA[Sessions]]></category>
		<category><![CDATA[SessionState]]></category>
		<category><![CDATA[State]]></category>

		<guid isPermaLink="false">http://rainstorms.me.uk/blog/?p=77</guid>
		<description><![CDATA[This entry is part of a series, ASP.NET Sessions&#187; ASP.NET gives you several alternatives for how the session data is stored on the server (remember that the clients just get a key to uniquely identify their session &#8211; not all the information is stored on their machines in cookies or anything). In Process State Server [...]


No related posts.

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<div class="hackadelic-series-info on-frontpage"><small>This entry is part of a series,  <a href="javascript:;" class="hackadelic-sliderButton"onclick="toggleSlider('#hackadelic-sliderPanel-6')" title="click to expand/collapse slider ASP.NET Sessions">ASP.NET Sessions&raquo;</a> <span class="hackadelic-sliderPanel concealed" id="hackadelic-sliderPanel-6"></span></small></div><p>ASP.NET gives you several alternatives for how the session data is stored on the server (remember that the clients just get a key to uniquely identify their session &#8211; not all the information is stored on their machines in cookies or anything).</p>
<ol>
<li>In Process</li>
<li>State Server</li>
<li>SQL Server</li>
<li>Custom</li>
</ol>
<p>These can be set by using the &#8220;mode&#8221; attribute of the &#8220;sessionState&#8221; element.</p>
<p>The &#8220;InProc&#8221; value (in-process) means that IIS stores the session state information within memory in the process that it uses for running the applications.  This is the default setting and is ok for many situations, but it has some big downsides.  All sessions are reset when the IIS process is recycled, which usually happens pretty randomly.  Also, all sessions are reset if you do a major rebuild of the site (which can be more of a pain than you think, especially as ASP.NET might do this behind the scenes if you change something in the App_Code folder).  The main advantage is that it is easy to configure and works out of the box.  Another advantage is that the data in the session state variables doesn&#8217;t have to be serialisable.</p>
<p>The &#8220;StateServer&#8221; value means that ASP.NET should look in the &#8220;stateConnectionString&#8221; attribute to find a connection string to connect to an ASP.NET &#8220;state server&#8221;.  A state server is a service which comes with ASP.NET (it doesn&#8217;t run by default &#8211; you&#8217;ll need to start it up and set it to run automatically when Windows starts).  You can find it in the folder %windir%\Microsoft.NET\Framework\VersionNumber\aspnet_state.exe .  Note that this doesn&#8217;t need to run on the same machine as IIS is running on, but it is probably sensible to run a state server of the same version as the version of IIS.  I&#8217;ve never used this myself though, so I can&#8217;t tell you how well it works.  The default connectionstring is to connect to the current server.   I expect that this will need data to be serialisable and will be able to retain the data as long as the sessionstate service isn&#8217;t restarted (even if IIS is).  It won&#8217;t retain data if the sessionstate service (or the whole server that it is running on) is restarted though.</p>
<p>The &#8220;SQLServer&#8221; option is my favourite.  This looks in the &#8220;sqlConnectionString&#8221; attribute for a connectionstring to an instance of SQL server which is configured for storing session state information.  ASP.NET 2.0 also added the &#8220;allowCustomSqlDatabase&#8221; element, which can be used to specify whether to use a customer SQL database instead of the default one.  nb.  You&#8217;ll need to setup SQL server for this, which you can either do by running the SQL script  %windir%\Microsoft.NET\Framework\version\InstallSqlState.sql or by using the Aspnet_regsql.exe utility to do it for you.</p>
<p>The &#8220;Custom&#8221; value allows you to specify your own class which is responsible for storing state information.  You&#8217;ll need to also add it to the providers section within the sessionState element and set the &#8220;customProvider&#8221; attribute to the name of the provider type.  Your custom class will need to inherit from SessionStoreProviderBase.</p>
<p>There is also another value &#8211; &#8220;Off&#8221;.  This turns off session state information being stored at all.</p>
<div id="hackadelic-sliderNote-6" class="concealed">Entries in this series:<ol><li><a href="http://rainstorms.me.uk/blog/2009/03/03/sessions-in-aspnet-part-1/">ASP.NET Sessions Part 1</a></li><li><a href="http://rainstorms.me.uk/blog/2009/03/04/sessions-in-aspnet-part-2-accessing-session-state-variable-data/">ASP.NET Sessions Part 2 - accessing session state variable data</a></li><li><a href="http://rainstorms.me.uk/blog/2009/03/09/aspnet-sessions-part-3-maintaining-the-session-data-across-multiple-requests/">ASP.NET Sessions Part 3 - Maintaining the Session Data Across Multiple Requests</a></li><li>ASP.NET Sessions Part 4 - Configuring how the Session Variable Data is Stored on the Server</li><li><a href="http://rainstorms.me.uk/blog/2009/03/12/aspnet-sessions-part-5-how-long-does-a-session-last/">ASP.NET Sessions Part 5 - How Long Does a Session Last?</a></li><li><a href="http://rainstorms.me.uk/blog/2009/03/13/aspnet-sessions-part-6-abandoning-a-session/">ASP.NET Sessions Part 6 - Abandoning a Session</a></li></ol><span style="display: block; margin-top: 3px; font-size: 7px"><a href="http://hackadelic.com/solutions/wordpress/sliding-notes" title="Powered by Hackadelic Sliding Notes 1.6.4">Powered by Hackadelic Sliding Notes 1.6.4</a></span></div><!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Bookmark this post</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2009%2F03%2F11%2Faspnet-sessions-part-4-configuring-how-the-session-variable-data-is-stored-on-the-server%2F&amp;title=ASP.NET+Sessions+Part+4+%26%238211%3B+Configuring+how+the+Session+Variable+Data+is+Stored+on+the+Server" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2009%2F03%2F11%2Faspnet-sessions-part-4-configuring-how-the-session-variable-data-is-stored-on-the-server%2F&amp;title=ASP.NET+Sessions+Part+4+%26%238211%3B+Configuring+how+the+Session+Variable+Data+is+Stored+on+the+Server" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.dotnetkicks.com/kick/?url=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2009%2F03%2F11%2Faspnet-sessions-part-4-configuring-how-the-session-variable-data-is-stored-on-the-server%2F&amp;title=ASP.NET+Sessions+Part+4+%26%238211%3B+Configuring+how+the+Session+Variable+Data+is+Stored+on+the+Server" rel="nofollow" title="Add to&nbsp;DotNetKicks"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/dotnetkicks.png" title="Add to&nbsp;DotNetKicks" alt="Add to&nbsp;DotNetKicks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2009%2F03%2F11%2Faspnet-sessions-part-4-configuring-how-the-session-variable-data-is-stored-on-the-server%2F" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://FriendSite.com/users/bookmarks/?u=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2009%2F03%2F11%2Faspnet-sessions-part-4-configuring-how-the-session-variable-data-is-stored-on-the-server%2F&amp;t=ASP.NET+Sessions+Part+4+%26%238211%3B+Configuring+how+the+Session+Variable+Data+is+Stored+on+the+Server" rel="nofollow" title="Add to&nbsp;FriendSite"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/friendsite.png" title="Add to&nbsp;FriendSite" alt="Add to&nbsp;FriendSite" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2009%2F03%2F11%2Faspnet-sessions-part-4-configuring-how-the-session-variable-data-is-stored-on-the-server%2F&amp;title=ASP.NET+Sessions+Part+4+%26%238211%3B+Configuring+how+the+Session+Variable+Data+is+Stored+on+the+Server" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2009%2F03%2F11%2Faspnet-sessions-part-4-configuring-how-the-session-variable-data-is-stored-on-the-server%2F&amp;title=ASP.NET+Sessions+Part+4+%26%238211%3B+Configuring+how+the+Session+Variable+Data+is+Stored+on+the+Server" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2009%2F03%2F11%2Faspnet-sessions-part-4-configuring-how-the-session-variable-data-is-stored-on-the-server%2F&amp;title=ASP.NET+Sessions+Part+4+%26%238211%3B+Configuring+how+the+Session+Variable+Data+is+Stored+on+the+Server" rel="nofollow" title="Add to&nbsp;Slashdot"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/slashdot.png" title="Add to&nbsp;Slashdot" alt="Add to&nbsp;Slashdot" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2009%2F03%2F11%2Faspnet-sessions-part-4-configuring-how-the-session-variable-data-is-stored-on-the-server%2F&amp;title=ASP.NET+Sessions+Part+4+%26%238211%3B+Configuring+how+the+Session+Variable+Data+is+Stored+on+the+Server" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.shoutwire.com/?p=submit&amp;link=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2009%2F03%2F11%2Faspnet-sessions-part-4-configuring-how-the-session-variable-data-is-stored-on-the-server%2F" rel="nofollow" title="Add to&nbsp;Shoutwire"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/shoutwire.png" title="Add to&nbsp;Shoutwire" alt="Add to&nbsp;Shoutwire" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2009%2F03%2F11%2Faspnet-sessions-part-4-configuring-how-the-session-variable-data-is-stored-on-the-server%2F" rel="nofollow" title="Add to&nbsp;Technorati"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2009%2F03%2F11%2Faspnet-sessions-part-4-configuring-how-the-session-variable-data-is-stored-on-the-server%2F&amp;t=ASP.NET+Sessions+Part+4+%26%238211%3B+Configuring+how+the+Session+Variable+Data+is+Stored+on+the+Server" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->


<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://rainstorms.me.uk/blog/2009/03/11/aspnet-sessions-part-4-configuring-how-the-session-variable-data-is-stored-on-the-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The ASP.NET Context Object (HTTPContext class)</title>
		<link>http://rainstorms.me.uk/blog/2009/03/10/the-aspnet-context-object-httpcontext-class/</link>
		<comments>http://rainstorms.me.uk/blog/2009/03/10/the-aspnet-context-object-httpcontext-class/#comments</comments>
		<pubDate>Tue, 10 Mar 2009 21:06:33 +0000</pubDate>
		<dc:creator>wizzard</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Context]]></category>
		<category><![CDATA[HttpContext]]></category>
		<category><![CDATA[Page]]></category>
		<category><![CDATA[Request]]></category>
		<category><![CDATA[Response]]></category>

		<guid isPermaLink="false">http://rainstorms.me.uk/blog/?p=79</guid>
		<description><![CDATA[Usually when you are using ASP.NET, much of the code that you write will be in a page. Since the Page class has properties to access Request, Response and other useful objects, you normally have access to whatever you need. However, sometimes, you aren&#8217;t working in a Page (eg. you are coding in App_Code or [...]


No related posts.

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>Usually when you are using ASP.NET, much of the code that you write will be in a page.  Since the Page class has properties to access Request, Response and other useful objects, you normally have access to whatever you need.  However, sometimes, you aren&#8217;t working in a Page (eg. you are coding in App_Code or in a DLL), and it is annoying to have to pass these objects as parameters to every function that may need them.</p>
<p>ASP.NET has a solution to this problem &#8211; the HttpContext class.  Thiosd class has a shared (static for C# coders) property called &#8220;Current&#8221;, which can be used to access the current context object.  This object contains most of all of the objects which you might need in properties.  For example, you can call HttpContext.Current.Response.Redirect.</p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Bookmark this post</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2009%2F03%2F10%2Fthe-aspnet-context-object-httpcontext-class%2F&amp;title=The+ASP.NET+Context+Object+%28HTTPContext+class%29" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2009%2F03%2F10%2Fthe-aspnet-context-object-httpcontext-class%2F&amp;title=The+ASP.NET+Context+Object+%28HTTPContext+class%29" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.dotnetkicks.com/kick/?url=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2009%2F03%2F10%2Fthe-aspnet-context-object-httpcontext-class%2F&amp;title=The+ASP.NET+Context+Object+%28HTTPContext+class%29" rel="nofollow" title="Add to&nbsp;DotNetKicks"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/dotnetkicks.png" title="Add to&nbsp;DotNetKicks" alt="Add to&nbsp;DotNetKicks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2009%2F03%2F10%2Fthe-aspnet-context-object-httpcontext-class%2F" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://FriendSite.com/users/bookmarks/?u=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2009%2F03%2F10%2Fthe-aspnet-context-object-httpcontext-class%2F&amp;t=The+ASP.NET+Context+Object+%28HTTPContext+class%29" rel="nofollow" title="Add to&nbsp;FriendSite"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/friendsite.png" title="Add to&nbsp;FriendSite" alt="Add to&nbsp;FriendSite" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2009%2F03%2F10%2Fthe-aspnet-context-object-httpcontext-class%2F&amp;title=The+ASP.NET+Context+Object+%28HTTPContext+class%29" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2009%2F03%2F10%2Fthe-aspnet-context-object-httpcontext-class%2F&amp;title=The+ASP.NET+Context+Object+%28HTTPContext+class%29" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2009%2F03%2F10%2Fthe-aspnet-context-object-httpcontext-class%2F&amp;title=The+ASP.NET+Context+Object+%28HTTPContext+class%29" rel="nofollow" title="Add to&nbsp;Slashdot"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/slashdot.png" title="Add to&nbsp;Slashdot" alt="Add to&nbsp;Slashdot" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2009%2F03%2F10%2Fthe-aspnet-context-object-httpcontext-class%2F&amp;title=The+ASP.NET+Context+Object+%28HTTPContext+class%29" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.shoutwire.com/?p=submit&amp;link=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2009%2F03%2F10%2Fthe-aspnet-context-object-httpcontext-class%2F" rel="nofollow" title="Add to&nbsp;Shoutwire"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/shoutwire.png" title="Add to&nbsp;Shoutwire" alt="Add to&nbsp;Shoutwire" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2009%2F03%2F10%2Fthe-aspnet-context-object-httpcontext-class%2F" rel="nofollow" title="Add to&nbsp;Technorati"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2009%2F03%2F10%2Fthe-aspnet-context-object-httpcontext-class%2F&amp;t=The+ASP.NET+Context+Object+%28HTTPContext+class%29" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->


<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://rainstorms.me.uk/blog/2009/03/10/the-aspnet-context-object-httpcontext-class/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ASP.NET Sessions Part 3 &#8211; Maintaining the Session Data Across Multiple Requests</title>
		<link>http://rainstorms.me.uk/blog/2009/03/09/aspnet-sessions-part-3-maintaining-the-session-data-across-multiple-requests/</link>
		<comments>http://rainstorms.me.uk/blog/2009/03/09/aspnet-sessions-part-3-maintaining-the-session-data-across-multiple-requests/#comments</comments>
		<pubDate>Mon, 09 Mar 2009 21:36:03 +0000</pubDate>
		<dc:creator>wizzard</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[ASP.NET Sessions]]></category>
		<category><![CDATA[Cookies]]></category>
		<category><![CDATA[Session]]></category>
		<category><![CDATA[Sessions]]></category>
		<category><![CDATA[SessionState]]></category>
		<category><![CDATA[State]]></category>

		<guid isPermaLink="false">http://rainstorms.me.uk/blog/?p=76</guid>
		<description><![CDATA[This entry is part of a series, ASP.NET Sessions&#187; In order to maintain the data on the server across multiple requests by the same user, the server needs some way of identifying the user. You may think that this can be done by IP address, but there are a couple of problems. Firstly, there is [...]


No related posts.

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<div class="hackadelic-series-info on-frontpage"><small>This entry is part of a series,  <a href="javascript:;" class="hackadelic-sliderButton"onclick="toggleSlider('#hackadelic-sliderPanel-8')" title="click to expand/collapse slider ASP.NET Sessions">ASP.NET Sessions&raquo;</a> <span class="hackadelic-sliderPanel concealed" id="hackadelic-sliderPanel-8"></span></small></div><p>In order to maintain the data on the server across multiple requests by the same user, the server needs some way of identifying the user.</p>
<p>You may think that this can be done by IP address, but there are a couple of problems.  Firstly, there is no guarantee that people are going to have a constant IP address &#8211; they may have multiple internet connections and a load-balancing router which will share their requests out among the different connections (this is becoming more and more common).  Secondly, they may be accessing the internet via a common invisible proxy server or a common NATed router which will mean that multiple users may appear all on the same IP address.</p>
<p>That means that we need to find another solution.  ASP.NET provides us with 2 alternatives.  We can use cookies, or we can use unique URLs (web addresses) with a session key encoded in them.  By default, ASP.NET uses cookies, but not all clients support them (some paranoid system administrators turn them off).  ASP.NET also presents us with an automatic mode, which is designed to detect whether cookies are available and if not, encode the key in the URL.  In my experience, this doesn&#8217;t always work.</p>
<p>The other problem with encoding the key in the URL is that ASP.NET can&#8217;t always reliably rewrite all URLs.  It works pretty well, by encoding it as virtual directory, but this looks messy, and of course it creates problems if people bookmark the URL.  It also loses the session if the user clicks a link which takes them to another site and then the site sends them back, or if the user retypes the original URL.</p>
<p>The sessionState element in web.config has an attribute called &#8220;cookieless&#8221;, which can be used to control whether cookies are used.</p>
<p>If it is set to &#8220;AutoDetect&#8221; (I think this is default), ASP.NET attempts (not reliably in my experiece) to detect whether the connecting browser supports cookies and use them if possible or if not fallback to URLs.</p>
<p>If it is set to &#8220;UseCookies&#8221;, ASP.NET will always try to use cookies, but they might not work.</p>
<p>If it is set to &#8220;UseDeviceProfile&#8221; (I think this is new in .NET 3/3.5 &#8211; not sure), ASP.NET uses System.Web.HttpBrowserCapabilities to try to find out whether the browser supports cookies.  MSDN seems a little hazy on how this works exactly, but I would guess that it is via the headers that the browser passes in the page request.</p>
<p>If it is set to &#8220;UseUri&#8221;, ASP.NET will always use URLs, irrespective of whether cookies will work.  I have had to use this setting at least once.</p>
<p>From ASP.NET 2.0, you are able to specify the cookie name if you are using cookies (it defaults to &#8220;ASP.NET_SessionId&#8221;) by specifying it in the &#8220;cookieName&#8221; attribute.</p>
<p>If you aren&#8217;t using cookies, there is also an optional boolean attribute called &#8220;regenerateExpiredSessionId&#8221;, which can be used to control what happens when a user comes back after the session has timed out with an old session ID.</p>
<div id="hackadelic-sliderNote-8" class="concealed">Entries in this series:<ol><li><a href="http://rainstorms.me.uk/blog/2009/03/03/sessions-in-aspnet-part-1/">ASP.NET Sessions Part 1</a></li><li><a href="http://rainstorms.me.uk/blog/2009/03/04/sessions-in-aspnet-part-2-accessing-session-state-variable-data/">ASP.NET Sessions Part 2 - accessing session state variable data</a></li><li>ASP.NET Sessions Part 3 - Maintaining the Session Data Across Multiple Requests</li><li><a href="http://rainstorms.me.uk/blog/2009/03/11/aspnet-sessions-part-4-configuring-how-the-session-variable-data-is-stored-on-the-server/">ASP.NET Sessions Part 4 - Configuring how the Session Variable Data is Stored on the Server</a></li><li><a href="http://rainstorms.me.uk/blog/2009/03/12/aspnet-sessions-part-5-how-long-does-a-session-last/">ASP.NET Sessions Part 5 - How Long Does a Session Last?</a></li><li><a href="http://rainstorms.me.uk/blog/2009/03/13/aspnet-sessions-part-6-abandoning-a-session/">ASP.NET Sessions Part 6 - Abandoning a Session</a></li></ol><span style="display: block; margin-top: 3px; font-size: 7px"><a href="http://hackadelic.com/solutions/wordpress/sliding-notes" title="Powered by Hackadelic Sliding Notes 1.6.4">Powered by Hackadelic Sliding Notes 1.6.4</a></span></div><!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Bookmark this post</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2009%2F03%2F09%2Faspnet-sessions-part-3-maintaining-the-session-data-across-multiple-requests%2F&amp;title=ASP.NET+Sessions+Part+3+%26%238211%3B+Maintaining+the+Session+Data+Across+Multiple+Requests" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2009%2F03%2F09%2Faspnet-sessions-part-3-maintaining-the-session-data-across-multiple-requests%2F&amp;title=ASP.NET+Sessions+Part+3+%26%238211%3B+Maintaining+the+Session+Data+Across+Multiple+Requests" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.dotnetkicks.com/kick/?url=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2009%2F03%2F09%2Faspnet-sessions-part-3-maintaining-the-session-data-across-multiple-requests%2F&amp;title=ASP.NET+Sessions+Part+3+%26%238211%3B+Maintaining+the+Session+Data+Across+Multiple+Requests" rel="nofollow" title="Add to&nbsp;DotNetKicks"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/dotnetkicks.png" title="Add to&nbsp;DotNetKicks" alt="Add to&nbsp;DotNetKicks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2009%2F03%2F09%2Faspnet-sessions-part-3-maintaining-the-session-data-across-multiple-requests%2F" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://FriendSite.com/users/bookmarks/?u=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2009%2F03%2F09%2Faspnet-sessions-part-3-maintaining-the-session-data-across-multiple-requests%2F&amp;t=ASP.NET+Sessions+Part+3+%26%238211%3B+Maintaining+the+Session+Data+Across+Multiple+Requests" rel="nofollow" title="Add to&nbsp;FriendSite"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/friendsite.png" title="Add to&nbsp;FriendSite" alt="Add to&nbsp;FriendSite" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2009%2F03%2F09%2Faspnet-sessions-part-3-maintaining-the-session-data-across-multiple-requests%2F&amp;title=ASP.NET+Sessions+Part+3+%26%238211%3B+Maintaining+the+Session+Data+Across+Multiple+Requests" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2009%2F03%2F09%2Faspnet-sessions-part-3-maintaining-the-session-data-across-multiple-requests%2F&amp;title=ASP.NET+Sessions+Part+3+%26%238211%3B+Maintaining+the+Session+Data+Across+Multiple+Requests" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2009%2F03%2F09%2Faspnet-sessions-part-3-maintaining-the-session-data-across-multiple-requests%2F&amp;title=ASP.NET+Sessions+Part+3+%26%238211%3B+Maintaining+the+Session+Data+Across+Multiple+Requests" rel="nofollow" title="Add to&nbsp;Slashdot"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/slashdot.png" title="Add to&nbsp;Slashdot" alt="Add to&nbsp;Slashdot" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2009%2F03%2F09%2Faspnet-sessions-part-3-maintaining-the-session-data-across-multiple-requests%2F&amp;title=ASP.NET+Sessions+Part+3+%26%238211%3B+Maintaining+the+Session+Data+Across+Multiple+Requests" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.shoutwire.com/?p=submit&amp;link=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2009%2F03%2F09%2Faspnet-sessions-part-3-maintaining-the-session-data-across-multiple-requests%2F" rel="nofollow" title="Add to&nbsp;Shoutwire"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/shoutwire.png" title="Add to&nbsp;Shoutwire" alt="Add to&nbsp;Shoutwire" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2009%2F03%2F09%2Faspnet-sessions-part-3-maintaining-the-session-data-across-multiple-requests%2F" rel="nofollow" title="Add to&nbsp;Technorati"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2009%2F03%2F09%2Faspnet-sessions-part-3-maintaining-the-session-data-across-multiple-requests%2F&amp;t=ASP.NET+Sessions+Part+3+%26%238211%3B+Maintaining+the+Session+Data+Across+Multiple+Requests" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->


<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://rainstorms.me.uk/blog/2009/03/09/aspnet-sessions-part-3-maintaining-the-session-data-across-multiple-requests/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google Chrome and Microsoft ASP.NET AJAX</title>
		<link>http://rainstorms.me.uk/blog/2009/03/04/google-chrome-and-microsoft-aspnet-ajax/</link>
		<comments>http://rainstorms.me.uk/blog/2009/03/04/google-chrome-and-microsoft-aspnet-ajax/#comments</comments>
		<pubDate>Wed, 04 Mar 2009 21:04:38 +0000</pubDate>
		<dc:creator>wizzard</dc:creator>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Google Chrome]]></category>
		<category><![CDATA[Workarounds]]></category>

		<guid isPermaLink="false">http://rainstorms.me.uk/blog/2009/03/04/google-chrome-and-microsoft-aspnet-ajax/</guid>
		<description><![CDATA[If you use ASP.NET AJAX and you or any of the people who use your site use Google Chrome, you might find that it causes trouble (this is actually a problem with ASP.NET AJAX, not Chrome &#8211; it also doesn&#8217;t like the latest version of Safari, which is also based on WebKit, the engine that [...]


No related posts.

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>If you use ASP.NET AJAX and you or any of the people who use your site use Google Chrome, you might find that it causes trouble (this is actually a problem with ASP.NET AJAX, not Chrome &#8211; it also doesn&#8217;t like the latest version of Safari, which is also based on WebKit, the engine that Chrome uses for rendering HTML).Anyway, you might want to look at <a href="http://blog.lavablast.com/post/2008/10/Gotcha-WebKit-(Safari-3-and-Google-Chrome)-Bug-with-ASPNET-AJAX.aspx" target="_blank">this blog entry</a> - they have come up with a nice solution to the problem.  I&#8217;ve tried it and it works really well.</p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Bookmark this post</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2009%2F03%2F04%2Fgoogle-chrome-and-microsoft-aspnet-ajax%2F&amp;title=Google+Chrome+and+Microsoft+ASP.NET+AJAX" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2009%2F03%2F04%2Fgoogle-chrome-and-microsoft-aspnet-ajax%2F&amp;title=Google+Chrome+and+Microsoft+ASP.NET+AJAX" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.dotnetkicks.com/kick/?url=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2009%2F03%2F04%2Fgoogle-chrome-and-microsoft-aspnet-ajax%2F&amp;title=Google+Chrome+and+Microsoft+ASP.NET+AJAX" rel="nofollow" title="Add to&nbsp;DotNetKicks"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/dotnetkicks.png" title="Add to&nbsp;DotNetKicks" alt="Add to&nbsp;DotNetKicks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2009%2F03%2F04%2Fgoogle-chrome-and-microsoft-aspnet-ajax%2F" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://FriendSite.com/users/bookmarks/?u=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2009%2F03%2F04%2Fgoogle-chrome-and-microsoft-aspnet-ajax%2F&amp;t=Google+Chrome+and+Microsoft+ASP.NET+AJAX" rel="nofollow" title="Add to&nbsp;FriendSite"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/friendsite.png" title="Add to&nbsp;FriendSite" alt="Add to&nbsp;FriendSite" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2009%2F03%2F04%2Fgoogle-chrome-and-microsoft-aspnet-ajax%2F&amp;title=Google+Chrome+and+Microsoft+ASP.NET+AJAX" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2009%2F03%2F04%2Fgoogle-chrome-and-microsoft-aspnet-ajax%2F&amp;title=Google+Chrome+and+Microsoft+ASP.NET+AJAX" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2009%2F03%2F04%2Fgoogle-chrome-and-microsoft-aspnet-ajax%2F&amp;title=Google+Chrome+and+Microsoft+ASP.NET+AJAX" rel="nofollow" title="Add to&nbsp;Slashdot"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/slashdot.png" title="Add to&nbsp;Slashdot" alt="Add to&nbsp;Slashdot" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2009%2F03%2F04%2Fgoogle-chrome-and-microsoft-aspnet-ajax%2F&amp;title=Google+Chrome+and+Microsoft+ASP.NET+AJAX" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.shoutwire.com/?p=submit&amp;link=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2009%2F03%2F04%2Fgoogle-chrome-and-microsoft-aspnet-ajax%2F" rel="nofollow" title="Add to&nbsp;Shoutwire"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/shoutwire.png" title="Add to&nbsp;Shoutwire" alt="Add to&nbsp;Shoutwire" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2009%2F03%2F04%2Fgoogle-chrome-and-microsoft-aspnet-ajax%2F" rel="nofollow" title="Add to&nbsp;Technorati"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2009%2F03%2F04%2Fgoogle-chrome-and-microsoft-aspnet-ajax%2F&amp;t=Google+Chrome+and+Microsoft+ASP.NET+AJAX" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->


<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://rainstorms.me.uk/blog/2009/03/04/google-chrome-and-microsoft-aspnet-ajax/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ASP.NET Sessions Part 2 &#8211; accessing session state variable data</title>
		<link>http://rainstorms.me.uk/blog/2009/03/04/sessions-in-aspnet-part-2-accessing-session-state-variable-data/</link>
		<comments>http://rainstorms.me.uk/blog/2009/03/04/sessions-in-aspnet-part-2-accessing-session-state-variable-data/#comments</comments>
		<pubDate>Wed, 04 Mar 2009 15:43:02 +0000</pubDate>
		<dc:creator>wizzard</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[.NET 2.0]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[ASP.NET Sessions]]></category>
		<category><![CDATA[Session]]></category>
		<category><![CDATA[Sessions]]></category>
		<category><![CDATA[SessionState]]></category>
		<category><![CDATA[State]]></category>

		<guid isPermaLink="false">http://rainstorms.me.uk/blog/2009/03/04/sessions-in-aspnet-part-2-accessing-session-state-variable-data/</guid>
		<description><![CDATA[This entry is part of a series, ASP.NET Sessions&#187; To add/set a session variable, from within code on a page, you can simply use Session(&#8220;VariableName&#8221;) = Value To reset it, you can set it to Nothing in VB.NET or null in C# If you aren&#8217;t inside a page&#8217;s code, you can use the HTTPContext class [...]


No related posts.

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<div class="hackadelic-series-info on-frontpage"><small>This entry is part of a series,  <a href="javascript:;" class="hackadelic-sliderButton"onclick="toggleSlider('#hackadelic-sliderPanel-10')" title="click to expand/collapse slider ASP.NET Sessions">ASP.NET Sessions&raquo;</a> <span class="hackadelic-sliderPanel concealed" id="hackadelic-sliderPanel-10"></span></small></div><p>To add/set a session variable, from within code on a page, you can simply use</p>
<p>Session(&#8220;VariableName&#8221;) = Value</p>
<p>To reset it, you can set it to Nothing in VB.NET or null in C#</p>
<p>If you aren&#8217;t inside a page&#8217;s code, you can use the HTTPContext class to get the current context and access the session via that (more coming on HTTPContexts at some point in the future).  You can do this like&#8230;</p>
<p>HTTPContext.Current.Session(&#8220;VariableName&#8221;) = Value</p>
<div id="hackadelic-sliderNote-10" class="concealed">Entries in this series:<ol><li><a href="http://rainstorms.me.uk/blog/2009/03/03/sessions-in-aspnet-part-1/">ASP.NET Sessions Part 1</a></li><li>ASP.NET Sessions Part 2 - accessing session state variable data</li><li><a href="http://rainstorms.me.uk/blog/2009/03/09/aspnet-sessions-part-3-maintaining-the-session-data-across-multiple-requests/">ASP.NET Sessions Part 3 - Maintaining the Session Data Across Multiple Requests</a></li><li><a href="http://rainstorms.me.uk/blog/2009/03/11/aspnet-sessions-part-4-configuring-how-the-session-variable-data-is-stored-on-the-server/">ASP.NET Sessions Part 4 - Configuring how the Session Variable Data is Stored on the Server</a></li><li><a href="http://rainstorms.me.uk/blog/2009/03/12/aspnet-sessions-part-5-how-long-does-a-session-last/">ASP.NET Sessions Part 5 - How Long Does a Session Last?</a></li><li><a href="http://rainstorms.me.uk/blog/2009/03/13/aspnet-sessions-part-6-abandoning-a-session/">ASP.NET Sessions Part 6 - Abandoning a Session</a></li></ol><span style="display: block; margin-top: 3px; font-size: 7px"><a href="http://hackadelic.com/solutions/wordpress/sliding-notes" title="Powered by Hackadelic Sliding Notes 1.6.4">Powered by Hackadelic Sliding Notes 1.6.4</a></span></div><!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Bookmark this post</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2009%2F03%2F04%2Fsessions-in-aspnet-part-2-accessing-session-state-variable-data%2F&amp;title=ASP.NET+Sessions+Part+2+%26%238211%3B+accessing+session+state+variable+data" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2009%2F03%2F04%2Fsessions-in-aspnet-part-2-accessing-session-state-variable-data%2F&amp;title=ASP.NET+Sessions+Part+2+%26%238211%3B+accessing+session+state+variable+data" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.dotnetkicks.com/kick/?url=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2009%2F03%2F04%2Fsessions-in-aspnet-part-2-accessing-session-state-variable-data%2F&amp;title=ASP.NET+Sessions+Part+2+%26%238211%3B+accessing+session+state+variable+data" rel="nofollow" title="Add to&nbsp;DotNetKicks"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/dotnetkicks.png" title="Add to&nbsp;DotNetKicks" alt="Add to&nbsp;DotNetKicks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2009%2F03%2F04%2Fsessions-in-aspnet-part-2-accessing-session-state-variable-data%2F" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://FriendSite.com/users/bookmarks/?u=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2009%2F03%2F04%2Fsessions-in-aspnet-part-2-accessing-session-state-variable-data%2F&amp;t=ASP.NET+Sessions+Part+2+%26%238211%3B+accessing+session+state+variable+data" rel="nofollow" title="Add to&nbsp;FriendSite"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/friendsite.png" title="Add to&nbsp;FriendSite" alt="Add to&nbsp;FriendSite" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2009%2F03%2F04%2Fsessions-in-aspnet-part-2-accessing-session-state-variable-data%2F&amp;title=ASP.NET+Sessions+Part+2+%26%238211%3B+accessing+session+state+variable+data" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2009%2F03%2F04%2Fsessions-in-aspnet-part-2-accessing-session-state-variable-data%2F&amp;title=ASP.NET+Sessions+Part+2+%26%238211%3B+accessing+session+state+variable+data" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2009%2F03%2F04%2Fsessions-in-aspnet-part-2-accessing-session-state-variable-data%2F&amp;title=ASP.NET+Sessions+Part+2+%26%238211%3B+accessing+session+state+variable+data" rel="nofollow" title="Add to&nbsp;Slashdot"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/slashdot.png" title="Add to&nbsp;Slashdot" alt="Add to&nbsp;Slashdot" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2009%2F03%2F04%2Fsessions-in-aspnet-part-2-accessing-session-state-variable-data%2F&amp;title=ASP.NET+Sessions+Part+2+%26%238211%3B+accessing+session+state+variable+data" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.shoutwire.com/?p=submit&amp;link=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2009%2F03%2F04%2Fsessions-in-aspnet-part-2-accessing-session-state-variable-data%2F" rel="nofollow" title="Add to&nbsp;Shoutwire"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/shoutwire.png" title="Add to&nbsp;Shoutwire" alt="Add to&nbsp;Shoutwire" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2009%2F03%2F04%2Fsessions-in-aspnet-part-2-accessing-session-state-variable-data%2F" rel="nofollow" title="Add to&nbsp;Technorati"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2009%2F03%2F04%2Fsessions-in-aspnet-part-2-accessing-session-state-variable-data%2F&amp;t=ASP.NET+Sessions+Part+2+%26%238211%3B+accessing+session+state+variable+data" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->


<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://rainstorms.me.uk/blog/2009/03/04/sessions-in-aspnet-part-2-accessing-session-state-variable-data/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ASP.NET Sessions Part 1</title>
		<link>http://rainstorms.me.uk/blog/2009/03/03/sessions-in-aspnet-part-1/</link>
		<comments>http://rainstorms.me.uk/blog/2009/03/03/sessions-in-aspnet-part-1/#comments</comments>
		<pubDate>Tue, 03 Mar 2009 07:16:55 +0000</pubDate>
		<dc:creator>wizzard</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[ASP.NET Sessions]]></category>
		<category><![CDATA[Session]]></category>
		<category><![CDATA[Sessions]]></category>
		<category><![CDATA[SessionState]]></category>
		<category><![CDATA[State]]></category>

		<guid isPermaLink="false">http://rainstorms.me.uk/blog/2009/03/03/sessions-in-aspnet-part-1/</guid>
		<description><![CDATA[This entry is part of a series, ASP.NET Sessions&#187; ASP.NET provides you with a method of storing data per session.  A session is related to the current user at the present time.  When it operates correctly, a session will span multiple requests for the same user.  This is very useful for example for allowing a [...]


No related posts.

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<div class="hackadelic-series-info on-frontpage"><small>This entry is part of a series,  <a href="javascript:;" class="hackadelic-sliderButton"onclick="toggleSlider('#hackadelic-sliderPanel-12')" title="click to expand/collapse slider ASP.NET Sessions">ASP.NET Sessions&raquo;</a> <span class="hackadelic-sliderPanel concealed" id="hackadelic-sliderPanel-12"></span></small></div><p>ASP.NET provides you with a method of storing data per session.  A session is related to the current user at the present time.  When it operates correctly, a session will span multiple requests for the same user.  This is very useful for example for allowing a user to login and storing their user ID in a session variable (although ASP.NET has other mechanisms for maintaining site logins, I am using this as an example).  There are several factors to consider when using sessions: -</p>
<ol>
<li>How will ASP.NET maintain the session across multiple requests (how does it know that different requests come from the same user)?</li>
<li>How will the session variables be stored on the server?</li>
<li>How long does a session last?</li>
</ol>
<p>There are probably other factors, but these are generally the most important ones in my experience.  Each of these factors can be controlled from the configuration/sessionstate element in web.config.  I will go into more detail about this in future posts.  Before that, I will explain how to access the session variables at all.</p>
<div id="hackadelic-sliderNote-12" class="concealed">Entries in this series:<ol><li>ASP.NET Sessions Part 1</li><li><a href="http://rainstorms.me.uk/blog/2009/03/04/sessions-in-aspnet-part-2-accessing-session-state-variable-data/">ASP.NET Sessions Part 2 - accessing session state variable data</a></li><li><a href="http://rainstorms.me.uk/blog/2009/03/09/aspnet-sessions-part-3-maintaining-the-session-data-across-multiple-requests/">ASP.NET Sessions Part 3 - Maintaining the Session Data Across Multiple Requests</a></li><li><a href="http://rainstorms.me.uk/blog/2009/03/11/aspnet-sessions-part-4-configuring-how-the-session-variable-data-is-stored-on-the-server/">ASP.NET Sessions Part 4 - Configuring how the Session Variable Data is Stored on the Server</a></li><li><a href="http://rainstorms.me.uk/blog/2009/03/12/aspnet-sessions-part-5-how-long-does-a-session-last/">ASP.NET Sessions Part 5 - How Long Does a Session Last?</a></li><li><a href="http://rainstorms.me.uk/blog/2009/03/13/aspnet-sessions-part-6-abandoning-a-session/">ASP.NET Sessions Part 6 - Abandoning a Session</a></li></ol><span style="display: block; margin-top: 3px; font-size: 7px"><a href="http://hackadelic.com/solutions/wordpress/sliding-notes" title="Powered by Hackadelic Sliding Notes 1.6.4">Powered by Hackadelic Sliding Notes 1.6.4</a></span></div><!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Bookmark this post</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2009%2F03%2F03%2Fsessions-in-aspnet-part-1%2F&amp;title=ASP.NET+Sessions+Part+1" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2009%2F03%2F03%2Fsessions-in-aspnet-part-1%2F&amp;title=ASP.NET+Sessions+Part+1" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.dotnetkicks.com/kick/?url=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2009%2F03%2F03%2Fsessions-in-aspnet-part-1%2F&amp;title=ASP.NET+Sessions+Part+1" rel="nofollow" title="Add to&nbsp;DotNetKicks"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/dotnetkicks.png" title="Add to&nbsp;DotNetKicks" alt="Add to&nbsp;DotNetKicks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2009%2F03%2F03%2Fsessions-in-aspnet-part-1%2F" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://FriendSite.com/users/bookmarks/?u=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2009%2F03%2F03%2Fsessions-in-aspnet-part-1%2F&amp;t=ASP.NET+Sessions+Part+1" rel="nofollow" title="Add to&nbsp;FriendSite"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/friendsite.png" title="Add to&nbsp;FriendSite" alt="Add to&nbsp;FriendSite" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2009%2F03%2F03%2Fsessions-in-aspnet-part-1%2F&amp;title=ASP.NET+Sessions+Part+1" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2009%2F03%2F03%2Fsessions-in-aspnet-part-1%2F&amp;title=ASP.NET+Sessions+Part+1" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2009%2F03%2F03%2Fsessions-in-aspnet-part-1%2F&amp;title=ASP.NET+Sessions+Part+1" rel="nofollow" title="Add to&nbsp;Slashdot"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/slashdot.png" title="Add to&nbsp;Slashdot" alt="Add to&nbsp;Slashdot" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2009%2F03%2F03%2Fsessions-in-aspnet-part-1%2F&amp;title=ASP.NET+Sessions+Part+1" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.shoutwire.com/?p=submit&amp;link=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2009%2F03%2F03%2Fsessions-in-aspnet-part-1%2F" rel="nofollow" title="Add to&nbsp;Shoutwire"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/shoutwire.png" title="Add to&nbsp;Shoutwire" alt="Add to&nbsp;Shoutwire" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2009%2F03%2F03%2Fsessions-in-aspnet-part-1%2F" rel="nofollow" title="Add to&nbsp;Technorati"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Frainstorms.me.uk%2Fblog%2F2009%2F03%2F03%2Fsessions-in-aspnet-part-1%2F&amp;t=ASP.NET+Sessions+Part+1" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://rainstorms.me.uk/blog/wp-content/plugins/social-bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->


<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://rainstorms.me.uk/blog/2009/03/03/sessions-in-aspnet-part-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
