<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: How to Create Totally Secure Cookies</title>
	<atom:link href="http://thinkvitamin.com/dev/how-to-create-totally-secure-cookies/feed/" rel="self" type="application/rss+xml" />
	<link>http://thinkvitamin.com/code/how-to-create-totally-secure-cookies/</link>
	<description>The Web Practitioner&#039;s Blog</description>
	<lastBuildDate>Sat, 11 Feb 2012 16:33:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>By: Andylei Lei</title>
		<link>http://thinkvitamin.com/code/how-to-create-totally-secure-cookies/#comment-39228</link>
		<dc:creator>Andylei Lei</dc:creator>
		<pubDate>Tue, 11 Jan 2011 09:12:00 +0000</pubDate>
		<guid isPermaLink="false">http://carsonified.com/?p=2945#comment-39228</guid>
		<description>This article is very useful for me because I am a new beginner for PC and do not know anything about the word&quot; cookie&quot;. Now I can use secure cookie and that make me happy.  http://www.mac-ipad-converter.org/</description>
		<content:encoded><![CDATA[<p>This article is very useful for me because I am a new beginner for PC and do not know anything about the word&#8221; cookie&#8221;. Now I can use secure cookie and that make me happy.  <a href="http://www.mac-ipad-converter.org/" rel="nofollow">http://www.mac-ipad-converter.org/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: intel drivers</title>
		<link>http://thinkvitamin.com/code/how-to-create-totally-secure-cookies/#comment-38910</link>
		<dc:creator>intel drivers</dc:creator>
		<pubDate>Thu, 30 Dec 2010 10:04:00 +0000</pubDate>
		<guid isPermaLink="false">http://carsonified.com/?p=2945#comment-38910</guid>
		<description>Your articale is really informative, but a little profound to me.
</description>
		<content:encoded><![CDATA[<p>Your articale is really informative, but a little profound to me.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael J</title>
		<link>http://thinkvitamin.com/code/how-to-create-totally-secure-cookies/#comment-21186</link>
		<dc:creator>Michael J</dc:creator>
		<pubDate>Fri, 11 Jun 2010 23:59:29 +0000</pubDate>
		<guid isPermaLink="false">http://carsonified.com/?p=2945#comment-21186</guid>
		<description>In your example you used isset($_SERVER[&quot;HTTPS&quot;]) to ensure that cookies will only be sent when it is over an HTTPS connection.  This will however not work as the this will just except the current setting.  Let me explain.  If I access the page via HTTP the value for this expression would be false, telling the browser to send cookies over HTTP and when accessed via HTTPS the expression would be true, thus sending cookies over the secure connection.
For HTTP the expression
setcookie( &#039;UserName&#039;, &#039;Bob&#039;, 0, &#039;/forums&#039;, &#039;www.example.com&#039;, isset($_SERVER[&quot;HTTPS&quot;]), true);
would result to
setcookie( &#039;UserName&#039;, &#039;Bob&#039;, 0, &#039;/forums&#039;, &#039;www.example.com&#039;,false, true); 
and for HTTPS 
setcookie( &#039;UserName&#039;, &#039;Bob&#039;, 0, &#039;/forums&#039;, &#039;www.example.com&#039;,true, true);</description>
		<content:encoded><![CDATA[<p>In your example you used isset($_SERVER["HTTPS"]) to ensure that cookies will only be sent when it is over an HTTPS connection.  This will however not work as the this will just except the current setting.  Let me explain.  If I access the page via HTTP the value for this expression would be false, telling the browser to send cookies over HTTP and when accessed via HTTPS the expression would be true, thus sending cookies over the secure connection.<br />
For HTTP the expression<br />
setcookie( &#8216;UserName&#8217;, &#8216;Bob&#8217;, 0, &#8216;/forums&#8217;, &#8216;www.example.com&#8217;, isset($_SERVER["HTTPS"]), true);<br />
would result to<br />
setcookie( &#8216;UserName&#8217;, &#8216;Bob&#8217;, 0, &#8216;/forums&#8217;, &#8216;www.example.com&#8217;,false, true);<br />
and for HTTPS<br />
setcookie( &#8216;UserName&#8217;, &#8216;Bob&#8217;, 0, &#8216;/forums&#8217;, &#8216;www.example.com&#8217;,true, true);</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andte</title>
		<link>http://thinkvitamin.com/code/how-to-create-totally-secure-cookies/#comment-19231</link>
		<dc:creator>Andte</dc:creator>
		<pubDate>Thu, 18 Mar 2010 02:15:18 +0000</pubDate>
		<guid isPermaLink="false">http://carsonified.com/?p=2945#comment-19231</guid>
		<description>Lars, your method is vulnerable to session hijacking.
See: Session hijacking on Wikipedia</description>
		<content:encoded><![CDATA[<p>Lars, your method is vulnerable to session hijacking.<br />
See: Session hijacking on Wikipedia</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: lace wedding dresses</title>
		<link>http://thinkvitamin.com/code/how-to-create-totally-secure-cookies/#comment-18896</link>
		<dc:creator>lace wedding dresses</dc:creator>
		<pubDate>Mon, 01 Mar 2010 11:31:22 +0000</pubDate>
		<guid isPermaLink="false">http://carsonified.com/?p=2945#comment-18896</guid>
		<description>There were quite a few hacks and sneaky tips that I didn&#039;t know about. Thanks</description>
		<content:encoded><![CDATA[<p>There were quite a few hacks and sneaky tips that I didn&#8217;t know about. Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: copy xbox 360 games</title>
		<link>http://thinkvitamin.com/code/how-to-create-totally-secure-cookies/#comment-16955</link>
		<dc:creator>copy xbox 360 games</dc:creator>
		<pubDate>Mon, 07 Dec 2009 03:18:33 +0000</pubDate>
		<guid isPermaLink="false">http://carsonified.com/?p=2945#comment-16955</guid>
		<description>hello admin, I found your blog from yahoo and read a few of your other posts.They are awesome. Please keep it up!! 
_____________________________________
&lt;a href=&quot;http://copyxbox360games.org/&quot; rel=&quot;nofollow&quot;&gt;copy xbox 360 games&lt;/a&gt;</description>
		<content:encoded><![CDATA[<p>hello admin, I found your blog from yahoo and read a few of your other posts.They are awesome. Please keep it up!!<br />
_____________________________________<br />
<a href="http://copyxbox360games.org/" rel="nofollow">copy xbox 360 games</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SAS Fire and Security</title>
		<link>http://thinkvitamin.com/code/how-to-create-totally-secure-cookies/#comment-16902</link>
		<dc:creator>SAS Fire and Security</dc:creator>
		<pubDate>Fri, 04 Dec 2009 05:47:04 +0000</pubDate>
		<guid isPermaLink="false">http://carsonified.com/?p=2945#comment-16902</guid>
		<description>Nice Information about cookies,

thanks a lot :-)</description>
		<content:encoded><![CDATA[<p>Nice Information about cookies,</p>
<p>thanks a lot :-)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: How to Create Totally Secure Cookies &#124; Benzing Technologies</title>
		<link>http://thinkvitamin.com/code/how-to-create-totally-secure-cookies/#comment-15839</link>
		<dc:creator>How to Create Totally Secure Cookies &#124; Benzing Technologies</dc:creator>
		<pubDate>Fri, 16 Oct 2009 02:08:17 +0000</pubDate>
		<guid isPermaLink="false">http://carsonified.com/?p=2945#comment-15839</guid>
		<description>[...] Tags: cookies, secure cookies, security      Originally Posted at Carsonified.com [...]</description>
		<content:encoded><![CDATA[<p>[...] Tags: cookies, secure cookies, security      Originally Posted at Carsonified.com [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jay</title>
		<link>http://thinkvitamin.com/code/how-to-create-totally-secure-cookies/#comment-15204</link>
		<dc:creator>Jay</dc:creator>
		<pubDate>Fri, 18 Sep 2009 11:33:11 +0000</pubDate>
		<guid isPermaLink="false">http://carsonified.com/?p=2945#comment-15204</guid>
		<description>The holidays are finished and so is a freshly made jar of those cookies, nice job:)</description>
		<content:encoded><![CDATA[<p>The holidays are finished and so is a freshly made jar of those cookies, nice job:)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: island</title>
		<link>http://thinkvitamin.com/code/how-to-create-totally-secure-cookies/#comment-14733</link>
		<dc:creator>island</dc:creator>
		<pubDate>Sat, 05 Sep 2009 05:27:07 +0000</pubDate>
		<guid isPermaLink="false">http://carsonified.com/?p=2945#comment-14733</guid>
		<description>This article is very useful for me because I am a new beginner for PC and do not know anything about the word&quot; cookie&quot;. Now I can use secure cookie and that make me happy.
&lt;a href=&quot;http://soykikao.blogspot.com&quot; rel=&quot;nofollow&quot;&gt;สร้อยไข่ขาว&lt;/a&gt;</description>
		<content:encoded><![CDATA[<p>This article is very useful for me because I am a new beginner for PC and do not know anything about the word&#8221; cookie&#8221;. Now I can use secure cookie and that make me happy.<br />
<a href="http://soykikao.blogspot.com" rel="nofollow">สร้อยไข่ขาว</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sam</title>
		<link>http://thinkvitamin.com/code/how-to-create-totally-secure-cookies/#comment-14731</link>
		<dc:creator>sam</dc:creator>
		<pubDate>Sat, 05 Sep 2009 02:53:34 +0000</pubDate>
		<guid isPermaLink="false">http://carsonified.com/?p=2945#comment-14731</guid>
		<description>My kids loves cookies and so are we.  Thanks for the tips, my wife would be very glad to know this. :)</description>
		<content:encoded><![CDATA[<p>My kids loves cookies and so are we.  Thanks for the tips, my wife would be very glad to know this. :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Friday Faves &#171; dalewatkins.com</title>
		<link>http://thinkvitamin.com/code/how-to-create-totally-secure-cookies/#comment-14703</link>
		<dc:creator>Friday Faves &#171; dalewatkins.com</dc:creator>
		<pubDate>Fri, 04 Sep 2009 14:32:52 +0000</pubDate>
		<guid isPermaLink="false">http://carsonified.com/?p=2945#comment-14703</guid>
		<description>[...] Create Totally Secure Cookies Cookies are a great way to store some information for recall across sessions, however, be careful with the information you store on your visitor&#8217;s computer. Do you create a secure cookie? [...]</description>
		<content:encoded><![CDATA[<p>[...] Create Totally Secure Cookies Cookies are a great way to store some information for recall across sessions, however, be careful with the information you store on your visitor&#8217;s computer. Do you create a secure cookie? [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mes favoris du 2-09-09 au 3-09-09</title>
		<link>http://thinkvitamin.com/code/how-to-create-totally-secure-cookies/#comment-14638</link>
		<dc:creator>Mes favoris du 2-09-09 au 3-09-09</dc:creator>
		<pubDate>Thu, 03 Sep 2009 16:09:23 +0000</pubDate>
		<guid isPermaLink="false">http://carsonified.com/?p=2945#comment-14638</guid>
		<description>[...] Carsonified &#187; How to Create Totally Secure Cookies &#8211; [...]</description>
		<content:encoded><![CDATA[<p>[...] Carsonified &raquo; How to Create Totally Secure Cookies &#8211; [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Revue de presse &#124; Simple Entrepreneur</title>
		<link>http://thinkvitamin.com/code/how-to-create-totally-secure-cookies/#comment-14604</link>
		<dc:creator>Revue de presse &#124; Simple Entrepreneur</dc:creator>
		<pubDate>Thu, 03 Sep 2009 05:11:56 +0000</pubDate>
		<guid isPermaLink="false">http://carsonified.com/?p=2945#comment-14604</guid>
		<description>[...] How to create totally secure cookies Un petit récapitulatif des différentes manières de sécuriser le contenu d&#8217;un cookie. Bien sûr, le conseil à toujours garder en mémoire reste de ne pas sauvegarder d&#8217;informations sensibles dans ces fichiers. [...]</description>
		<content:encoded><![CDATA[<p>[...] How to create totally secure cookies Un petit récapitulatif des différentes manières de sécuriser le contenu d&#8217;un cookie. Bien sûr, le conseil à toujours garder en mémoire reste de ne pas sauvegarder d&#8217;informations sensibles dans ces fichiers. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jean Marie</title>
		<link>http://thinkvitamin.com/code/how-to-create-totally-secure-cookies/#comment-14576</link>
		<dc:creator>Jean Marie</dc:creator>
		<pubDate>Wed, 02 Sep 2009 14:23:24 +0000</pubDate>
		<guid isPermaLink="false">http://carsonified.com/?p=2945#comment-14576</guid>
		<description>Hi,

using the users remote IP is a bad idea because many users sit behind a NAT-Gateway.

Best regards
Jean Marie</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>using the users remote IP is a bad idea because many users sit behind a NAT-Gateway.</p>
<p>Best regards<br />
Jean Marie</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: solitaire</title>
		<link>http://thinkvitamin.com/code/how-to-create-totally-secure-cookies/#comment-14498</link>
		<dc:creator>solitaire</dc:creator>
		<pubDate>Tue, 01 Sep 2009 09:13:14 +0000</pubDate>
		<guid isPermaLink="false">http://carsonified.com/?p=2945#comment-14498</guid>
		<description>Great explanation of what are cookies, thanks for sharing.</description>
		<content:encoded><![CDATA[<p>Great explanation of what are cookies, thanks for sharing.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Carsonified &#187; How to Create Bulletproof Sessions</title>
		<link>http://thinkvitamin.com/code/how-to-create-totally-secure-cookies/#comment-14490</link>
		<dc:creator>Carsonified &#187; How to Create Bulletproof Sessions</dc:creator>
		<pubDate>Tue, 01 Sep 2009 07:02:03 +0000</pubDate>
		<guid isPermaLink="false">http://carsonified.com/?p=2945#comment-14490</guid>
		<description>[...] the first part of this series we went over how a cookie works and what can be done to secure them. In this section we&#8217;re going to go over ways to add additional security to the session beyond [...]</description>
		<content:encoded><![CDATA[<p>[...] the first part of this series we went over how a cookie works and what can be done to secure them. In this section we&#8217;re going to go over ways to add additional security to the session beyond [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Friday Links: 28 August 2009</title>
		<link>http://thinkvitamin.com/code/how-to-create-totally-secure-cookies/#comment-14318</link>
		<dc:creator>Friday Links: 28 August 2009</dc:creator>
		<pubDate>Fri, 28 Aug 2009 15:05:14 +0000</pubDate>
		<guid isPermaLink="false">http://carsonified.com/?p=2945#comment-14318</guid>
		<description>[...] How to Create Totally Secure Cookies [...]</description>
		<content:encoded><![CDATA[<p>[...] How to Create Totally Secure Cookies [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ansermot.ch &#187; Secure cookies in PHP</title>
		<link>http://thinkvitamin.com/code/how-to-create-totally-secure-cookies/#comment-14226</link>
		<dc:creator>Ansermot.ch &#187; Secure cookies in PHP</dc:creator>
		<pubDate>Thu, 27 Aug 2009 15:17:04 +0000</pubDate>
		<guid isPermaLink="false">http://carsonified.com/?p=2945#comment-14226</guid>
		<description>[...] complete post : How to Create Totally Secure Cookies   Share and [...]</description>
		<content:encoded><![CDATA[<p>[...] complete post : How to Create Totally Secure Cookies   Share and [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sécuriser les cookies &#124; traffic-internet.net</title>
		<link>http://thinkvitamin.com/code/how-to-create-totally-secure-cookies/#comment-14120</link>
		<dc:creator>Sécuriser les cookies &#124; traffic-internet.net</dc:creator>
		<pubDate>Wed, 26 Aug 2009 12:04:47 +0000</pubDate>
		<guid isPermaLink="false">http://carsonified.com/?p=2945#comment-14120</guid>
		<description>[...] &#160;How to Create Totally Secure Cookies (0 visite) [...]</description>
		<content:encoded><![CDATA[<p>[...] &nbsp;How to Create Totally Secure Cookies (0 visite) [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ennuyer.net &#187; Blog Archive &#187; Rails Reading - August 26, 2009</title>
		<link>http://thinkvitamin.com/code/how-to-create-totally-secure-cookies/#comment-14107</link>
		<dc:creator>Ennuyer.net &#187; Blog Archive &#187; Rails Reading - August 26, 2009</dc:creator>
		<pubDate>Wed, 26 Aug 2009 09:48:02 +0000</pubDate>
		<guid isPermaLink="false">http://carsonified.com/?p=2945#comment-14107</guid>
		<description>[...]  Carsonified » How to Create Totally Secure Cookies  [...]</description>
		<content:encoded><![CDATA[<p>[...]  Carsonified » How to Create Totally Secure Cookies  [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: vivanno.com::aggregator &#187; Archive &#187; Sécuriser les cookies</title>
		<link>http://thinkvitamin.com/code/how-to-create-totally-secure-cookies/#comment-14105</link>
		<dc:creator>vivanno.com::aggregator &#187; Archive &#187; Sécuriser les cookies</dc:creator>
		<pubDate>Wed, 26 Aug 2009 09:30:59 +0000</pubDate>
		<guid isPermaLink="false">http://carsonified.com/?p=2945#comment-14105</guid>
		<description>[...] &#160;How to Create Totally Secure Cookies () [...]</description>
		<content:encoded><![CDATA[<p>[...] &nbsp;How to Create Totally Secure Cookies () [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daily Links for Tuesday, August 25th, 2009</title>
		<link>http://thinkvitamin.com/code/how-to-create-totally-secure-cookies/#comment-14064</link>
		<dc:creator>Daily Links for Tuesday, August 25th, 2009</dc:creator>
		<pubDate>Tue, 25 Aug 2009 11:31:09 +0000</pubDate>
		<guid isPermaLink="false">http://carsonified.com/?p=2945#comment-14064</guid>
		<description>[...] Carsonified » How to Create Totally Secure Cookies [...]</description>
		<content:encoded><![CDATA[<p>[...] Carsonified » How to Create Totally Secure Cookies [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: How to Create Totally Secure Cookies &#124; Benzing Technologies &#124; Creative Web Design, Affordable Web Hosting, SEO, Social Media Marketing</title>
		<link>http://thinkvitamin.com/code/how-to-create-totally-secure-cookies/#comment-14052</link>
		<dc:creator>How to Create Totally Secure Cookies &#124; Benzing Technologies &#124; Creative Web Design, Affordable Web Hosting, SEO, Social Media Marketing</dc:creator>
		<pubDate>Tue, 25 Aug 2009 03:37:22 +0000</pubDate>
		<guid isPermaLink="false">http://carsonified.com/?p=2945#comment-14052</guid>
		<description>[...] Originally Posted at Carsonified.com [...]</description>
		<content:encoded><![CDATA[<p>[...] Originally Posted at Carsonified.com [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: links for 2009-08-24 .:: [aka щямукюшт] Ozver.in &#124; Озверин</title>
		<link>http://thinkvitamin.com/code/how-to-create-totally-secure-cookies/#comment-14051</link>
		<dc:creator>links for 2009-08-24 .:: [aka щямукюшт] Ozver.in &#124; Озверин</dc:creator>
		<pubDate>Tue, 25 Aug 2009 03:05:18 +0000</pubDate>
		<guid isPermaLink="false">http://carsonified.com/?p=2945#comment-14051</guid>
		<description>[...] Carsonified » How to Create Totally Secure Cookies (tags: security development php usability http reference howto css secure cookies) [...]</description>
		<content:encoded><![CDATA[<p>[...] Carsonified » How to Create Totally Secure Cookies (tags: security development php usability http reference howto css secure cookies) [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bruce</title>
		<link>http://thinkvitamin.com/code/how-to-create-totally-secure-cookies/#comment-14036</link>
		<dc:creator>Bruce</dc:creator>
		<pubDate>Mon, 24 Aug 2009 19:44:36 +0000</pubDate>
		<guid isPermaLink="false">http://carsonified.com/?p=2945#comment-14036</guid>
		<description>I believe Safari 4 also supports HttpOnly on cookies.  Finally.</description>
		<content:encoded><![CDATA[<p>I believe Safari 4 also supports HttpOnly on cookies.  Finally.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tedivm</title>
		<link>http://thinkvitamin.com/code/how-to-create-totally-secure-cookies/#comment-14032</link>
		<dc:creator>tedivm</dc:creator>
		<pubDate>Mon, 24 Aug 2009 17:49:53 +0000</pubDate>
		<guid isPermaLink="false">http://carsonified.com/?p=2945#comment-14032</guid>
		<description>This technique has merit, but there are a few things to consider-

* If you&#039;re primarily using the data server side, it would be better to simply store it in a session. Otherwise, while you&#039;re protected from tampering you&#039;re still open to sniffing of sensitive data and hijacking of cookies. 

* Tying it to the user id only helps so much, as the user id won&#039;t be present until the session is already loaded. This would, from the perspective of the hackers, just make the hash another session id. If they can steal the session (and take on the user ID) they&#039;ll be able to steal the other cookies as well.

* If someone logs out all of their cookies are invalidated- this may be intentional, but if you want data tied to a session it should be in the session.

* If you&#039;re using the data client side (javascript) you&#039;re only going to have read only access.


That being said, I really should have touched on this subject, as there are definite cases where it would be useful. Thank you for fixing that discrepancy on my part.</description>
		<content:encoded><![CDATA[<p>This technique has merit, but there are a few things to consider-</p>
<p>* If you&#8217;re primarily using the data server side, it would be better to simply store it in a session. Otherwise, while you&#8217;re protected from tampering you&#8217;re still open to sniffing of sensitive data and hijacking of cookies. </p>
<p>* Tying it to the user id only helps so much, as the user id won&#8217;t be present until the session is already loaded. This would, from the perspective of the hackers, just make the hash another session id. If they can steal the session (and take on the user ID) they&#8217;ll be able to steal the other cookies as well.</p>
<p>* If someone logs out all of their cookies are invalidated- this may be intentional, but if you want data tied to a session it should be in the session.</p>
<p>* If you&#8217;re using the data client side (javascript) you&#8217;re only going to have read only access.</p>
<p>That being said, I really should have touched on this subject, as there are definite cases where it would be useful. Thank you for fixing that discrepancy on my part.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tedivm</title>
		<link>http://thinkvitamin.com/code/how-to-create-totally-secure-cookies/#comment-14029</link>
		<dc:creator>tedivm</dc:creator>
		<pubDate>Mon, 24 Aug 2009 17:09:58 +0000</pubDate>
		<guid isPermaLink="false">http://carsonified.com/?p=2945#comment-14029</guid>
		<description>My point wasn&#039;t to try to get people to come back and read more later, its just that the cookie itself is a small part of the session. The next article focused on sessions, and uses a lot of example code, so by the time it was done it seemed big enough to stand on its own (its much longer than this post, for instance).

I definitely understand what you&#039;re saying though, and will keep it in mind for future posts (I am still rather new at this).</description>
		<content:encoded><![CDATA[<p>My point wasn&#8217;t to try to get people to come back and read more later, its just that the cookie itself is a small part of the session. The next article focused on sessions, and uses a lot of example code, so by the time it was done it seemed big enough to stand on its own (its much longer than this post, for instance).</p>
<p>I definitely understand what you&#8217;re saying though, and will keep it in mind for future posts (I am still rather new at this).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lars</title>
		<link>http://thinkvitamin.com/code/how-to-create-totally-secure-cookies/#comment-14020</link>
		<dc:creator>Lars</dc:creator>
		<pubDate>Mon, 24 Aug 2009 13:46:05 +0000</pubDate>
		<guid isPermaLink="false">http://carsonified.com/?p=2945#comment-14020</guid>
		<description>You shouldn&#039;t store sensitive information in cookies. Store the bare minimum, and implement tampering detection like kari or jamie mentions.
Alternatively use an ID and a checksum and store it in a database... E.g.

// To &quot;encode&quot;
$id = 232; // ID to a database record, for instance
$my_secret = md5( &quot;Some secret, eh?&quot; );
$checksum = md5( md5( $id ) . $my_secret );

// To decode:
list( $id, $checksum ) = explode( &quot;-&quot;, $_COOKIE[&#039;the_cookie&#039;] );
$my_secret = md5( &quot;Some secret, eh?&quot; );
if ( md5( md5( $id ) . $my_secret ) != $checksum )
{
   die( &quot;Tampering detected&quot; );
}

In the database you can store whatever you want.</description>
		<content:encoded><![CDATA[<p>You shouldn&#8217;t store sensitive information in cookies. Store the bare minimum, and implement tampering detection like kari or jamie mentions.<br />
Alternatively use an ID and a checksum and store it in a database&#8230; E.g.</p>
<p>// To &#8220;encode&#8221;<br />
$id = 232; // ID to a database record, for instance<br />
$my_secret = md5( &#8220;Some secret, eh?&#8221; );<br />
$checksum = md5( md5( $id ) . $my_secret );</p>
<p>// To decode:<br />
list( $id, $checksum ) = explode( &#8220;-&#8221;, $_COOKIE['the_cookie'] );<br />
$my_secret = md5( &#8220;Some secret, eh?&#8221; );<br />
if ( md5( md5( $id ) . $my_secret ) != $checksum )<br />
{<br />
   die( &#8220;Tampering detected&#8221; );<br />
}</p>
<p>In the database you can store whatever you want.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Geert</title>
		<link>http://thinkvitamin.com/code/how-to-create-totally-secure-cookies/#comment-14018</link>
		<dc:creator>Geert</dc:creator>
		<pubDate>Mon, 24 Aug 2009 13:09:21 +0000</pubDate>
		<guid isPermaLink="false">http://carsonified.com/?p=2945#comment-14018</guid>
		<description>Signing cookies indeed is a good idea. The cookie helper of the Kohana PHP5 framework uses a very similar technique. Very clean code and well commented, good to learn from: &lt;a href=&quot;http://github.com/kohana/core/blob/eff20419b63e049fecbdb7a99167284c82088374/classes/kohana/cookie.php&quot; rel=&quot;nofollow&quot;&gt;Kohana_Cookie class&lt;/a&gt;.</description>
		<content:encoded><![CDATA[<p>Signing cookies indeed is a good idea. The cookie helper of the Kohana PHP5 framework uses a very similar technique. Very clean code and well commented, good to learn from: <a href="http://github.com/kohana/core/blob/eff20419b63e049fecbdb7a99167284c82088374/classes/kohana/cookie.php" rel="nofollow">Kohana_Cookie class</a>.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic page generated in 0.434 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2012-02-11 21:33:38 -->

