<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" media="screen" href="/styles/xslt/rss.xslt"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:c9="http://channel9.msdn.com">
<channel>
	<title>Channel 9 Forums - Tech Off - Cookie Question</title>
	<atom:link rel="self" type="application/rss+xml" href="http://channel9.msdn.com/Forums/rss"></atom:link>
	<image>
		<url>http://mschnlnine.vo.llnwd.net/d1/Dev/App_Themes/C9/images/feedimage.png</url>
		<title>Channel 9 Forums - Tech Off - Cookie Question</title>
		<link>http://channel9.msdn.com/Forums</link>
	</image>
	<description>Channel 9 keeps you up to date with the latest news and behind the scenes info from Microsoft that developers love to keep up with. From LINQ to SilverLight – Watch videos and hear about all the cool technologies coming and the people behind them.</description>
	<link>http://channel9.msdn.com/Forums</link>
	<language>en</language>
	<pubDate>Wed, 22 May 2013 21:06:40 GMT</pubDate>
	<lastBuildDate>Wed, 22 May 2013 21:06:40 GMT</lastBuildDate>
	<generator>Rev9</generator>
	<c9:totalResults>9</c9:totalResults>
	<c9:pageCount>-9</c9:pageCount>
	<c9:pageSize>-1</c9:pageSize>
	<item>
		<title>Tech Off - Cookie Question</title>
		<description><![CDATA[<p><font color="#008080" size="2">In some&nbsp;button click&nbsp;event:<br />foreach</font><font size="2"> (</font><font color="#2b91af" size="2">HttpCookie</font><font size="2"> cookie
</font><font color="#008080" size="2">in</font><font size="2"> Request.Cookies)</p>
<p>{</p>
<p>cookie.Expires = </font><font color="#2b91af" size="2">DateTime</font><font size="2">.Now;</p>
<p>}<br /><br />Say I am in&nbsp;PST as a client and the server is EST.&nbsp;Would my cookies expire now (percievable on next request)&nbsp;or in 3 hours?</p>
</font>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/259245-Cookie-Question/259245#259245</link>
		<pubDate>Mon, 26 Nov 2007 21:44:50 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/259245-Cookie-Question/259245#259245</guid>
		<dc:creator>odujosh</dc:creator>
		<slash:comments>9</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/odujosh/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Cookie Question</title>
		<description><![CDATA[<p>Pick a date that's years before Now().</p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/259245-Cookie-Question/b5df7343acb84c27a7ae9dfa00905b76#b5df7343acb84c27a7ae9dfa00905b76</link>
		<pubDate>Mon, 26 Nov 2007 21:55:40 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/259245-Cookie-Question/b5df7343acb84c27a7ae9dfa00905b76#b5df7343acb84c27a7ae9dfa00905b76</guid>
		<dc:creator>ZippyV</dc:creator>
		<slash:comments>9</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/ZippyV/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Cookie Question</title>
		<description><![CDATA[<p>The time in the cookie would be in GMT, so you also wouldn't have the issue with time zones or winter time, but if you really want to expire it (time on server and time on client can be slightly off) expire it with:<br /><br />cookie.Expires = <font color="#2b91af" size="2">DateTime</font>.Now.AddYears(-1);<br /></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/259245-Cookie-Question/b8b9f5a9d1d6487eb0d19dfa00905bcc#b8b9f5a9d1d6487eb0d19dfa00905bcc</link>
		<pubDate>Mon, 26 Nov 2007 22:23:26 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/259245-Cookie-Question/b8b9f5a9d1d6487eb0d19dfa00905bcc#b8b9f5a9d1d6487eb0d19dfa00905bcc</guid>
		<dc:creator>PeterF</dc:creator>
		<slash:comments>9</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/PeterF/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Cookie Question</title>
		<description><![CDATA[<p><blockquote>
<div class="quoteAuthor">PeterF wrote:</div>
<div class="quoteBody">&#65279;The time in the cookie would be in GMT, so you also wouldn't have the issue with time zones or winter time, but if you really want to expire it (time on server and time on client can be slightly off) expire it with:<br /><br />cookie.Expires = <font color="#2b91af" size="2">DateTime</font>.Now.AddYears(-1);<br /></div>
</blockquote>
<br /><br />How would you figure out time zone of DateTime. How to adjust for GMT?&nbsp;I am curious about a&nbsp;more precise answer if anyone has one.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/259245-Cookie-Question/4345a22c26c14f98903b9dfa00905c21#4345a22c26c14f98903b9dfa00905c21</link>
		<pubDate>Mon, 26 Nov 2007 22:34:25 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/259245-Cookie-Question/4345a22c26c14f98903b9dfa00905c21#4345a22c26c14f98903b9dfa00905c21</guid>
		<dc:creator>odujosh</dc:creator>
		<slash:comments>9</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/odujosh/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Cookie Question</title>
		<description><![CDATA[<p><br />The help text indicates that what you have should do it.<img src='http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-5.gif' alt='Wink' /><br /><br /><a href="http://msdn2.microsoft.com/en-us/library/system.web.httpcookie.expires.aspx">http://msdn2.microsoft.com/en-us/library/system.web.httpcookie.expires.aspx</a></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/259245-Cookie-Question/b1f415a606ea4df887e09dfa00905c73#b1f415a606ea4df887e09dfa00905c73</link>
		<pubDate>Mon, 26 Nov 2007 23:12:37 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/259245-Cookie-Question/b1f415a606ea4df887e09dfa00905c73#b1f415a606ea4df887e09dfa00905c73</guid>
		<dc:creator>longnight</dc:creator>
		<slash:comments>9</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/longnight/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Cookie Question</title>
		<description><![CDATA[<p>Yeah it seems to be a situation of do what I say not as I do (from documentation):<br /><br /><h4 class="subHeading">Property Value</h4>
The time of day (on the client) at which the cookie expires.<br /><br /><br />Then they turn around show:<br /><br />DateTime dt = DateTime.Now;<br />TimeSpan ts = <span>new</span> TimeSpan(0,0,10,0);<br /><br />MyCookie.Expires = dt.Add(ts);<br /><br /><br />DateTime.Now being the time on the server. So the right hand isn't talking to the left hand:)<br /><br />Without building a TimeZone property into the user profile or defaulting to some timezone&nbsp;how do you figure out the clients timezone. Is there some javascript trick I should be aware of <img src='http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-4.gif' alt='Tongue Out' /><br /><br />So which is right? The text or the code?</p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/259245-Cookie-Question/c468c476a09e441191d79dfa00905cc6#c468c476a09e441191d79dfa00905cc6</link>
		<pubDate>Tue, 27 Nov 2007 01:17:04 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/259245-Cookie-Question/c468c476a09e441191d79dfa00905cc6#c468c476a09e441191d79dfa00905cc6</guid>
		<dc:creator>odujosh</dc:creator>
		<slash:comments>9</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/odujosh/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Cookie Question</title>
		<description><![CDATA[<p>The header is actually sent as a text representation of&nbsp;the date and for the cookie to be valid, it must be in the form:
<br /><br />DAY, DD-MMM-YYYY HH:MM:SS GMT<br /><br />Since the function you are using takes care of the conversion from a DateTime object to this text, I would hope it would to the conversion for you.<br /><br />I will be testing it as soon as I get VWD Express 2008 installed. <img src='http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-1.gif' alt='Smiley' /></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/259245-Cookie-Question/46f870149b9c441badbc9dfa00905d3a#46f870149b9c441badbc9dfa00905d3a</link>
		<pubDate>Tue, 27 Nov 2007 01:46:14 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/259245-Cookie-Question/46f870149b9c441badbc9dfa00905d3a#46f870149b9c441badbc9dfa00905d3a</guid>
		<dc:creator>Jorgie</dc:creator>
		<slash:comments>9</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Jorgie/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Cookie Question</title>
		<description><![CDATA[<p><blockquote>
<div class="quoteAuthor">odujosh wrote:</div>
<div class="quoteBody">&#65279;<br />How would you figure out time zone of DateTime. How to adjust for GMT?&nbsp;I am curious about a&nbsp;more precise answer if anyone has one.</div>
</blockquote>
<br /><br />That's the thing, by expressing the DateTime object in GMT time, you completely avoid things like time zone and summer and winter time.<br /><br />GMT time is completely neutral in that sense, and the DateTime format used by the cookie object takes advantage of that.<br /><br />The only thing is, because the cookie object lifetime is not expressed in Time To Live (TTL), you always have a descrepancy between server time and client time. You can try to compensate it by synchronizing things, but you always have the issue of how long
 a transaction will take or the execution time or the transport time.<br /><br />In that sense try to avoid expressing this explicitely yourself in the form of cookies, but use the session timeout mechanisms in stead provided by .NET and/or IIS<br /><br />Good luck,<br />Peter</p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/259245-Cookie-Question/345a578cd2d346ed8f759dfa00905deb#345a578cd2d346ed8f759dfa00905deb</link>
		<pubDate>Tue, 27 Nov 2007 12:52:13 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/259245-Cookie-Question/345a578cd2d346ed8f759dfa00905deb#345a578cd2d346ed8f759dfa00905deb</guid>
		<dc:creator>PeterF</dc:creator>
		<slash:comments>9</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/PeterF/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Cookie Question</title>
		<description><![CDATA[<p>odujosh,</p>
<p>I just ran a test that shows that the conversion is made from server time zone&nbsp;to client time zone. However, if the client time is off by a few minutes, then the cookie can hang around for a few, or die a few minutes&nbsp;too soon.&nbsp;The source code for the test&nbsp;is
 in the Sandbox.<br /><br />For&nbsp;absolute accuracy,&nbsp;you would&nbsp;need nab the client time and time zone, then&nbsp;convert the client time to the&nbsp;server time zone.<br /><br />gl...<br /><br />let me know if you nab the client time and time zone.<br /><br />btw, you could just store the server time in&nbsp;a cookie and check for expiration yourself.<br /><br /></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/259245-Cookie-Question/a26b283d0b98475d933e9dfa00905d90#a26b283d0b98475d933e9dfa00905d90</link>
		<pubDate>Thu, 29 Nov 2007 03:02:35 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/259245-Cookie-Question/a26b283d0b98475d933e9dfa00905d90#a26b283d0b98475d933e9dfa00905d90</guid>
		<dc:creator>longnight</dc:creator>
		<slash:comments>9</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/longnight/Discussions/RSS</wfw:commentRss>
	</item>
</channel>
</rss>