<?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>Chris Cook .me &#187; script</title>
	<atom:link href="http://chriscook.me/tag/script/feed/" rel="self" type="application/rss+xml" />
	<link>http://chriscook.me</link>
	<description>Homepage</description>
	<lastBuildDate>Sat, 31 Jul 2010 22:52:47 +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>PHP: Session Timeouts</title>
		<link>http://chriscook.me/web-development/php-session-timeouts/</link>
		<comments>http://chriscook.me/web-development/php-session-timeouts/#comments</comments>
		<pubDate>Thu, 26 Nov 2009 22:31:50 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[chris cook]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[session]]></category>
		<category><![CDATA[timeout]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://chriscook.me/?p=117</guid>
		<description><![CDATA[Defining session timeout thresholds for PHP scripts is a security &#8220;must&#8221;. I recommend that you consider the purpose of your script before applying a session timeout function. For instance, if your site has a secure login and security requirements, it&#8217;s important to include the timeout function. However, it&#8217;s often an inconvenience to end-users. Use the [...]]]></description>
			<content:encoded><![CDATA[<p>Defining session timeout thresholds for PHP scripts is a security &#8220;must&#8221;.  I recommend that you consider the purpose of your script before applying a session timeout function.  For instance, if your site has a secure login and security requirements, it&#8217;s important to include the timeout function. However, it&#8217;s often an inconvenience to end-users.</p>
<p>Use the code below to create a function which can be used to implement a secure timeout threshold.</p>
<pre class="php">
<span class="phpComment">/* Set timeout threshold to 10 minutes <span class="phpOperator">(</span>600 seconds<span class="phpOperator">)</span> */</span>
@<span class="phpFunction">session_start</span><span class="phpOperator">(</span><span class="phpOperator">)</span><span class="phpText">;</span>
$timeout <span class="phpOperator">=</span> 600;
<span class="phpScriptVar">$_SESSION</span><span class="phpOperator">[</span><span class="phpString">"expires_by"</span><span class="phpOperator">]</span> <span class="phpOperator">=</span> <span class="phpFunction">time</span><span class="phpOperator">(</span><span class="phpOperator">)</span> <span class="phpOperator">+</span> $timeout;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://chriscook.me/web-development/php-session-timeouts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
