<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Xylot Design &#187; ASP</title>
	<atom:link href="http://xylotdesign.wordpress.com/tag/asp/feed/" rel="self" type="application/rss+xml" />
	<link>http://xylotdesign.wordpress.com</link>
	<description>useful scripts, ideas, and tips!</description>
	<lastBuildDate>Fri, 21 Mar 2008 20:39:45 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='xylotdesign.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/d47e221117c84d128bbe00e39a6140a7?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>Xylot Design &#187; ASP</title>
		<link>http://xylotdesign.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://xylotdesign.wordpress.com/osd.xml" title="Xylot Design" />
		<item>
		<title>ASP: Reading and Writing Cookies</title>
		<link>http://xylotdesign.wordpress.com/2008/03/21/asp-reading-and-writing-cookies/</link>
		<comments>http://xylotdesign.wordpress.com/2008/03/21/asp-reading-and-writing-cookies/#comments</comments>
		<pubDate>Fri, 21 Mar 2008 17:04:04 +0000</pubDate>
		<dc:creator>Xylot Design</dc:creator>
				<category><![CDATA[ASP]]></category>
		<category><![CDATA[arrays]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[cookies]]></category>
		<category><![CDATA[favorites]]></category>
		<category><![CDATA[login]]></category>
		<category><![CDATA[preferences]]></category>
		<category><![CDATA[sessions]]></category>
		<category><![CDATA[stats]]></category>
		<category><![CDATA[variables]]></category>
		<category><![CDATA[visitors]]></category>

		<guid isPermaLink="false">http://xylotdesign.wordpress.com/?p=11</guid>
		<description><![CDATA[Cookies are powerful things. Not only are they sweet and tasty, but they store useful information on your visitors&#8217; computers as well! You can use them to check if a user has visited your site before, or store their login information, preferences, favorites, and other stats.
But how do you use them in ASP? This tutorial [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=xylotdesign.wordpress.com&blog=3153931&post=11&subd=xylotdesign&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Cookies are powerful things. Not only are they sweet and tasty, but they store useful information on your visitors&#8217; computers as well! You can use them to check if a user has visited your site before, or store their login information, preferences, favorites, and other stats.</p>
<p>But how do you use them in ASP? This tutorial shows you just that.<span id="more-11"></span></p>
<h1>The Commands</h1>
<p>To write a cookie to the user&#8217;s computer, we use the Response.Cookies command.</p>
<pre>Response.Cookies("CookieName") = SomeValue</pre>
<p>To retrieve a cookie&#8217;s value, we simply call the command.</p>
<pre>Dim CookieValue = Response.Cookies("CookieName")</pre>
<p>ASP has probably one of the easiest implementations of cookies of any programming language. There are other attributes of a cookie we can set as well.</p>
<p>Let&#8217;s say our user has logged in.</p>
<pre>&lt;%
    Dim strUserName = "Bob123"
    Response.Cookies("UserName") = strUserName
    Response.Cookies("IsLoggedIn") = True
    Response.Cookies("UserName").Expires = Now() + 60
    Response.Cookies("IsLoggedIn").Expires = Now() + 60
%&gt;</pre>
<p>We just gave the &#8220;UserName&#8221; and &#8220;IsLoggedIn&#8221; cookies an expiration date 60 days in the future (<b>Now() + 60</b>).</p>
<p>What if we want to check if our user is logged in, and display a welcome message accordingly?</p>
<pre>&lt;%
    If Response.Cookies("IsLoggedIn") = True Then
        Response.Write("Welcome, " &amp; Response.Cookies("UserName"))
    Else
        Response.Write("Welcome, stranger!")
    End If
%&gt;</pre>
<p>It&#8217;s as simple as that. But wait, there&#8217;s more! You can also make a cookie expire as soon as the user closes his or her browser; don&#8217;t set the Expires attribute at all.</p>
<p>To assign a specific date value for the expiration date:</p>
<pre>&lt;% Response.Cookies("UserName").Expires = #April 15, 2010# %&gt;</pre>
<h1>Cookie Arrays</h1>
<p>A cookie can contain a collection of multiple values. This is useful for, say, shopping carts where each item in your cart has several values assigned to it: product ID, quantity, base price, etc.</p>
<pre>&lt;%
    Response.Cookies("Item")("ItemID") = 1234
    Response.Cookies("Item")("BasePrice") = 74.95
    Response.Cookies("Item")("Name") = "Deluxe 4-Slice Toaster"
%&gt;</pre>
<p>Finally, what if you want to get rid of a cookie? Since cookies can&#8217;t be removed, per se, you can set them to expire <i>now</i> and they will essentially cease to exist.</p>
<pre>&lt;% Response.Cookies("UserName").Expires = Now() %&gt;</pre>
<p>As you can see, there are many uses for cookies, and in ASP it is really quite simple to utilize them. I never made any use of cookies for a long time; I stuck to session variables for everything. Once I actually got into cookies, I could never go back. They&#8217;re an invaluable resource.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/xylotdesign.wordpress.com/11/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/xylotdesign.wordpress.com/11/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/xylotdesign.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/xylotdesign.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/xylotdesign.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/xylotdesign.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/xylotdesign.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/xylotdesign.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/xylotdesign.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/xylotdesign.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/xylotdesign.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/xylotdesign.wordpress.com/11/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=xylotdesign.wordpress.com&blog=3153931&post=11&subd=xylotdesign&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://xylotdesign.wordpress.com/2008/03/21/asp-reading-and-writing-cookies/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b31bda9bb80f4c9b9f507a02539c79e7?s=96&#38;d=identicon" medium="image">
			<media:title type="html">Xylot Design</media:title>
		</media:content>
	</item>
		<item>
		<title>Welcome!</title>
		<link>http://xylotdesign.wordpress.com/2008/03/14/welcome/</link>
		<comments>http://xylotdesign.wordpress.com/2008/03/14/welcome/#comments</comments>
		<pubDate>Fri, 14 Mar 2008 02:16:12 +0000</pubDate>
		<dc:creator>Xylot Design</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[AJAX]]></category>
		<category><![CDATA[ASP]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[js]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://xylotdesign.wordpress.com/?p=3</guid>
		<description><![CDATA[Welcome to the blog of Xylot Design!
The purpose of this blog is to share code snippets, functions, programming methods, design ideas, and other innovations with the world. We&#8217;ll be posting informational and extremely useful pieces of code. Just wait until we show you what we have in store for you!
      [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=xylotdesign.wordpress.com&blog=3153931&post=3&subd=xylotdesign&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Welcome to the blog of Xylot Design!</p>
<p>The purpose of this blog is to share code snippets, functions, programming methods, design ideas, and other innovations with the world. We&#8217;ll be posting informational and extremely useful pieces of code. Just wait until we show you what we have in store for you!</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/xylotdesign.wordpress.com/3/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/xylotdesign.wordpress.com/3/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/xylotdesign.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/xylotdesign.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/xylotdesign.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/xylotdesign.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/xylotdesign.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/xylotdesign.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/xylotdesign.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/xylotdesign.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/xylotdesign.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/xylotdesign.wordpress.com/3/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=xylotdesign.wordpress.com&blog=3153931&post=3&subd=xylotdesign&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://xylotdesign.wordpress.com/2008/03/14/welcome/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b31bda9bb80f4c9b9f507a02539c79e7?s=96&#38;d=identicon" medium="image">
			<media:title type="html">Xylot Design</media:title>
		</media:content>
	</item>
	</channel>
</rss>