<?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: Working with Sessions and Cookies in PHP and MYSQL</title>
	<atom:link href="http://blog.themeforest.net/tutorials/working-with-sessions-and-cookies-in-php-and-mysql/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.themeforest.net/tutorials/working-with-sessions-and-cookies-in-php-and-mysql/</link>
	<description>The ThemeForest Blog</description>
	<lastBuildDate>Mon, 27 Sep 2010 19:49:11 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: 20+ PHP Tutorials &#38; Resources &#171; Powerusers</title>
		<link>http://blog.themeforest.net/tutorials/working-with-sessions-and-cookies-in-php-and-mysql/comment-page-1/#comment-25598</link>
		<dc:creator>20+ PHP Tutorials &#38; Resources &#171; Powerusers</dc:creator>
		<pubDate>Tue, 29 Sep 2009 19:18:08 +0000</pubDate>
		<guid isPermaLink="false">http://blog.themeforest.net/?p=2185#comment-25598</guid>
		<description>[...] 15. Working with Sessions and Cookies in PHP and MySQL [...]</description>
		<content:encoded><![CDATA[<p>[...] 15. Working with Sessions and Cookies in PHP and MySQL [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vonnero</title>
		<link>http://blog.themeforest.net/tutorials/working-with-sessions-and-cookies-in-php-and-mysql/comment-page-1/#comment-24512</link>
		<dc:creator>Vonnero</dc:creator>
		<pubDate>Sat, 19 Sep 2009 13:05:58 +0000</pubDate>
		<guid isPermaLink="false">http://blog.themeforest.net/?p=2185#comment-24512</guid>
		<description>Great tutorial.....thanks, please keep it up..... on sanitizing database inputs... here is a tutorial for sanitizing any input on the go.....

http://ilogical.wordpress.com/2009/09/19/form-validation-made-easy/

contributions or refactoring is highly appreciated....</description>
		<content:encoded><![CDATA[<p>Great tutorial&#8230;..thanks, please keep it up&#8230;.. on sanitizing database inputs&#8230; here is a tutorial for sanitizing any input on the go&#8230;..</p>
<p><a href="http://ilogical.wordpress.com/2009/09/19/form-validation-made-easy/" rel="nofollow">http://ilogical.wordpress.com/2009/09/19/form-validation-made-easy/</a></p>
<p>contributions or refactoring is highly appreciated&#8230;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David Riveroll</title>
		<link>http://blog.themeforest.net/tutorials/working-with-sessions-and-cookies-in-php-and-mysql/comment-page-1/#comment-20358</link>
		<dc:creator>David Riveroll</dc:creator>
		<pubDate>Fri, 14 Aug 2009 06:34:12 +0000</pubDate>
		<guid isPermaLink="false">http://blog.themeforest.net/?p=2185#comment-20358</guid>
		<description>This is just what I needed.
I&#039;d like more security related tutorials as this one, I&#039;ve never had any worries cause my websites weren&#039;t worth hacking, but now I&#039;m getting bigger projects and I want to be prepared.

Thanks a lot for your input Aditya</description>
		<content:encoded><![CDATA[<p>This is just what I needed.<br />
I&#8217;d like more security related tutorials as this one, I&#8217;ve never had any worries cause my websites weren&#8217;t worth hacking, but now I&#8217;m getting bigger projects and I want to be prepared.</p>
<p>Thanks a lot for your input Aditya</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rocky</title>
		<link>http://blog.themeforest.net/tutorials/working-with-sessions-and-cookies-in-php-and-mysql/comment-page-1/#comment-20172</link>
		<dc:creator>Rocky</dc:creator>
		<pubDate>Wed, 12 Aug 2009 15:29:10 +0000</pubDate>
		<guid isPermaLink="false">http://blog.themeforest.net/?p=2185#comment-20172</guid>
		<description>Quote:

function session_encrypt($string) {
$salt = ‘asdfsdfsdfa’;
$string = md5($salt . $string);
}

Dont u mean

function createsomesortofhash($fromthisstring){
$salt = &quot;sosdldsldsldsksdklds&quot;;
$string = md5($salt,$string);
}

because you are using the salt at the start of the string!?</description>
		<content:encoded><![CDATA[<p>Quote:</p>
<p>function session_encrypt($string) {<br />
$salt = ‘asdfsdfsdfa’;<br />
$string = md5($salt . $string);<br />
}</p>
<p>Dont u mean</p>
<p>function createsomesortofhash($fromthisstring){<br />
$salt = &#8220;sosdldsldsldsksdklds&#8221;;<br />
$string = md5($salt,$string);<br />
}</p>
<p>because you are using the salt at the start of the string!?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Miles Johnson</title>
		<link>http://blog.themeforest.net/tutorials/working-with-sessions-and-cookies-in-php-and-mysql/comment-page-1/#comment-18707</link>
		<dc:creator>Miles Johnson</dc:creator>
		<pubDate>Sat, 01 Aug 2009 04:54:35 +0000</pubDate>
		<guid isPermaLink="false">http://blog.themeforest.net/?p=2185#comment-18707</guid>
		<description>I wrote a session class that manages sessions, some people could probably learn from it.

http://www.milesj.me/resources/script/session-manager</description>
		<content:encoded><![CDATA[<p>I wrote a session class that manages sessions, some people could probably learn from it.</p>
<p><a href="http://www.milesj.me/resources/script/session-manager" rel="nofollow">http://www.milesj.me/resources/script/session-manager</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Roman Cortes</title>
		<link>http://blog.themeforest.net/tutorials/working-with-sessions-and-cookies-in-php-and-mysql/comment-page-1/#comment-18657</link>
		<dc:creator>Roman Cortes</dc:creator>
		<pubDate>Fri, 31 Jul 2009 16:42:16 +0000</pubDate>
		<guid isPermaLink="false">http://blog.themeforest.net/?p=2185#comment-18657</guid>
		<description>Please, correct that insecure mysql injectable code!

Why are you writing an article on security if you don&#039;t take the time to make the sample code secure!?

I&#039;m sure your blog have a lot of readers... please take care of them by correcting the unsafe samples soon...

Also, be free to delete this comment, I just wanted to show my worries to you.</description>
		<content:encoded><![CDATA[<p>Please, correct that insecure mysql injectable code!</p>
<p>Why are you writing an article on security if you don&#8217;t take the time to make the sample code secure!?</p>
<p>I&#8217;m sure your blog have a lot of readers&#8230; please take care of them by correcting the unsafe samples soon&#8230;</p>
<p>Also, be free to delete this comment, I just wanted to show my worries to you.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David the Day</title>
		<link>http://blog.themeforest.net/tutorials/working-with-sessions-and-cookies-in-php-and-mysql/comment-page-1/#comment-18655</link>
		<dc:creator>David the Day</dc:creator>
		<pubDate>Fri, 31 Jul 2009 16:18:03 +0000</pubDate>
		<guid isPermaLink="false">http://blog.themeforest.net/?p=2185#comment-18655</guid>
		<description>You can also add IP checking to this method. While user&#039;s IP address do change, they are not likely to change in the middle of a session. So adding an IP field to the database, and checking that the IP is the same for a session is an additional check against session hijacking. I added an article below that uses the IP field as well.

Here is the article, look at the cookie/session model (NOT the HTTP/HTTPS model). It uses oracle for the DB, but it&#039;s very easily converted to MySQL: http://www.oracle.com/technology/pub/articles/mclaughlin-phpid1.html

ADDITIONAL NOTES (IMPORTANT!!!!): 

As others have stated, the author doesn&#039;t touch on SQL injection attacks, and they&#039;ve posted sanitation methods. There is also another method: prepared statements. Look up mysqli prepare, it does all the sanitation for you :)

Also, this article and the one I&#039;ve provided use either MD5 or sha-1. Both of these encryption methods have been hacked. It&#039;s best to use something stronger, such as sha-256, sha-512, or whirlpool for example.</description>
		<content:encoded><![CDATA[<p>You can also add IP checking to this method. While user&#8217;s IP address do change, they are not likely to change in the middle of a session. So adding an IP field to the database, and checking that the IP is the same for a session is an additional check against session hijacking. I added an article below that uses the IP field as well.</p>
<p>Here is the article, look at the cookie/session model (NOT the HTTP/HTTPS model). It uses oracle for the DB, but it&#8217;s very easily converted to MySQL: <a href="http://www.oracle.com/technology/pub/articles/mclaughlin-phpid1.html" rel="nofollow">http://www.oracle.com/technology/pub/articles/mclaughlin-phpid1.html</a></p>
<p>ADDITIONAL NOTES (IMPORTANT!!!!): </p>
<p>As others have stated, the author doesn&#8217;t touch on SQL injection attacks, and they&#8217;ve posted sanitation methods. There is also another method: prepared statements. Look up mysqli prepare, it does all the sanitation for you <img src='http://blog.themeforest.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Also, this article and the one I&#8217;ve provided use either MD5 or sha-1. Both of these encryption methods have been hacked. It&#8217;s best to use something stronger, such as sha-256, sha-512, or whirlpool for example.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: In the Woods - Working with Sessions and Cookies in PHP and MYSQL &#171; Netcrema - creme de la social news via digg + delicious + stumpleupon + reddit</title>
		<link>http://blog.themeforest.net/tutorials/working-with-sessions-and-cookies-in-php-and-mysql/comment-page-1/#comment-18632</link>
		<dc:creator>In the Woods - Working with Sessions and Cookies in PHP and MYSQL &#171; Netcrema - creme de la social news via digg + delicious + stumpleupon + reddit</dc:creator>
		<pubDate>Fri, 31 Jul 2009 10:40:52 +0000</pubDate>
		<guid isPermaLink="false">http://blog.themeforest.net/?p=2185#comment-18632</guid>
		<description>[...] In the Woods - Working with Sessions and Cookies in PHP and MYSQLblog.themeforest.net [...]</description>
		<content:encoded><![CDATA[<p>[...] In the Woods &#8211; Working with Sessions and Cookies in PHP and MYSQLblog.themeforest.net [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: onnay okheng</title>
		<link>http://blog.themeforest.net/tutorials/working-with-sessions-and-cookies-in-php-and-mysql/comment-page-1/#comment-18631</link>
		<dc:creator>onnay okheng</dc:creator>
		<pubDate>Fri, 31 Jul 2009 10:10:18 +0000</pubDate>
		<guid isPermaLink="false">http://blog.themeforest.net/?p=2185#comment-18631</guid>
		<description>that&#039;s excellent..
thank&#039;s... ;)</description>
		<content:encoded><![CDATA[<p>that&#8217;s excellent..<br />
thank&#8217;s&#8230; <img src='http://blog.themeforest.net/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: J.R.</title>
		<link>http://blog.themeforest.net/tutorials/working-with-sessions-and-cookies-in-php-and-mysql/comment-page-1/#comment-18630</link>
		<dc:creator>J.R.</dc:creator>
		<pubDate>Fri, 31 Jul 2009 10:04:36 +0000</pubDate>
		<guid isPermaLink="false">http://blog.themeforest.net/?p=2185#comment-18630</guid>
		<description>Another good secure idea is to use the secure flag on your cookies, even ones with session.  Also not a bad idea to use HTTPOnly but ti depends on what you are doing.</description>
		<content:encoded><![CDATA[<p>Another good secure idea is to use the secure flag on your cookies, even ones with session.  Also not a bad idea to use HTTPOnly but ti depends on what you are doing.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
