<?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>Alex Jeffery &#187; CakePHP</title>
	<atom:link href="http://www.alexjeffery.org/category/programming/cakephp/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.alexjeffery.org</link>
	<description></description>
	<lastBuildDate>Sun, 09 Aug 2009 05:14:38 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>CakePHP session lost when using Applets or Flash</title>
		<link>http://www.alexjeffery.org/programming/cakephp/cakephp-session-lost-when-using-applets-or-flash/</link>
		<comments>http://www.alexjeffery.org/programming/cakephp/cakephp-session-lost-when-using-applets-or-flash/#comments</comments>
		<pubDate>Wed, 26 Mar 2008 23:40:55 +0000</pubDate>
		<dc:creator>Alex Jeffery</dc:creator>
				<category><![CDATA[CakePHP]]></category>
		<category><![CDATA[Pulpcore]]></category>

		<guid isPermaLink="false">http://blog.alexjeffery.org/2008/03/27/cakephp-session-lost-when-using-applets-or-flash/</guid>
		<description><![CDATA[Recently I have been developing a website on my dev machine using the CakePHP framework. During this I ran into a problem where I could log a user in, view a Pulpcore applet and then be logged out right after viewing it.
After doing a bit of searching on the net I found the cause and [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I have been developing a website on my dev machine using the <a href="http://www.cakephp.org/">CakePHP</a> framework. During this I ran into a problem where I could log a user in, view a Pulpcore applet and then be logged out right after viewing it.</p>
<p>After doing a bit of searching on the net I found the cause and the solution.</p>
<p>The cause:<br />
My Pulpcore applet trying to do a request a CakePHP action from the web server to get and set the highscores.<br />
CakePHP would check the HTTP_USER_AGENT and compare it to the one used to create the session.<br />
When it found that they differed it would kill the session thinking it was preventing a session hijack attempt.</p>
<p>A solution:<br />
In the config/core.php set the following lines<br />
Configure::write(&#8217;Session.checkAgent&#8217;, false);<br />
Configure::write(&#8217;Security.level&#8217;, &#8216;medium&#8217;);</p>
<p>This will stop CakePHP from regenerating a session every request and stop CakePHP from checking the user agent.<br />
After that my Pulpcore applets where able to request actions as the logged in user fine and keep the session alive.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.alexjeffery.org/programming/cakephp/cakephp-session-lost-when-using-applets-or-flash/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
