<?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: Symfony security, sessions not cleared when logging out</title>
	<atom:link href="http://eatmymonkeydust.com/2008/08/symfony-security-sessions-not-cleared-when-logging-out/feed/" rel="self" type="application/rss+xml" />
	<link>http://eatmymonkeydust.com/2008/08/symfony-security-sessions-not-cleared-when-logging-out/</link>
	<description>Life, PHP and Symfony - straight from the monkey's mouth</description>
	<lastBuildDate>Mon, 25 Jul 2011 10:23:41 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Richard</title>
		<link>http://eatmymonkeydust.com/2008/08/symfony-security-sessions-not-cleared-when-logging-out/comment-page-1/#comment-363</link>
		<dc:creator>Richard</dc:creator>
		<pubDate>Wed, 03 Feb 2010 09:52:09 +0000</pubDate>
		<guid isPermaLink="false">http://eatmymonkeydust.com/?p=36#comment-363</guid>
		<description>When I clicked on logout and if I go &quot;Back&quot; with Browser Back button, then inside page is coming again. Is there any way to stop showing inside page? once user clicked on logout.</description>
		<content:encoded><![CDATA[<p>When I clicked on logout and if I go &#8220;Back&#8221; with Browser Back button, then inside page is coming again. Is there any way to stop showing inside page? once user clicked on logout.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: zairo</title>
		<link>http://eatmymonkeydust.com/2008/08/symfony-security-sessions-not-cleared-when-logging-out/comment-page-1/#comment-287</link>
		<dc:creator>zairo</dc:creator>
		<pubDate>Thu, 12 Feb 2009 09:13:24 +0000</pubDate>
		<guid isPermaLink="false">http://eatmymonkeydust.com/?p=36#comment-287</guid>
		<description>Mr Bart, your idea rock! Thank a lot. Now my session is totally clear after logout. :)</description>
		<content:encoded><![CDATA[<p>Mr Bart, your idea rock! Thank a lot. Now my session is totally clear after logout. <img src='http://eatmymonkeydust.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bart</title>
		<link>http://eatmymonkeydust.com/2008/08/symfony-security-sessions-not-cleared-when-logging-out/comment-page-1/#comment-285</link>
		<dc:creator>Bart</dc:creator>
		<pubDate>Thu, 22 Jan 2009 19:34:04 +0000</pubDate>
		<guid isPermaLink="false">http://eatmymonkeydust.com/?p=36#comment-285</guid>
		<description>Just a reminder that session values in Symfony can be stored in both a parameter holder and an attribute holder.

So, while regenerating the session is the safest way to go, if you have to keep the session but need to remove any Symfony values be certain to clear them both.

$this-&gt;getUser()-&gt;getParameterHolder()-&gt;clear();
$this-&gt;getUser()-&gt;getAttributeHolder()-&gt;clear();

Thanks for the blog clearing this up!</description>
		<content:encoded><![CDATA[<p>Just a reminder that session values in Symfony can be stored in both a parameter holder and an attribute holder.</p>
<p>So, while regenerating the session is the safest way to go, if you have to keep the session but need to remove any Symfony values be certain to clear them both.</p>
<p>$this-&gt;getUser()-&gt;getParameterHolder()-&gt;clear();<br />
$this-&gt;getUser()-&gt;getAttributeHolder()-&gt;clear();</p>
<p>Thanks for the blog clearing this up!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Russ</title>
		<link>http://eatmymonkeydust.com/2008/08/symfony-security-sessions-not-cleared-when-logging-out/comment-page-1/#comment-276</link>
		<dc:creator>Russ</dc:creator>
		<pubDate>Wed, 26 Nov 2008 16:02:50 +0000</pubDate>
		<guid isPermaLink="false">http://eatmymonkeydust.com/?p=36#comment-276</guid>
		<description>Thomas: From a PHP security perspective, it is better not to just rely on clearing the Symfony attributes - totally regenerating the session is the safest way to go.

Zairo: You should not be editing the plugin, if you need to override some of the functionality you should override the class in your own workspace.

You should check that the file that you are editing is actually the one that Symfony is loading - put die(&quot;hello world&quot;); in there or something and click logout, just to see if you are actually having any effect at all.</description>
		<content:encoded><![CDATA[<p>Thomas: From a PHP security perspective, it is better not to just rely on clearing the Symfony attributes &#8211; totally regenerating the session is the safest way to go.</p>
<p>Zairo: You should not be editing the plugin, if you need to override some of the functionality you should override the class in your own workspace.</p>
<p>You should check that the file that you are editing is actually the one that Symfony is loading &#8211; put die(&#8220;hello world&#8221;); in there or something and click logout, just to see if you are actually having any effect at all.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: zairo</title>
		<link>http://eatmymonkeydust.com/2008/08/symfony-security-sessions-not-cleared-when-logging-out/comment-page-1/#comment-275</link>
		<dc:creator>zairo</dc:creator>
		<pubDate>Wed, 26 Nov 2008 15:41:08 +0000</pubDate>
		<guid isPermaLink="false">http://eatmymonkeydust.com/?p=36#comment-275</guid>
		<description>hi. I try all the suggestions but to no avail. Please help me.

prjname/plugins/sfGuardPlugin/modules/sfGuardAuth/lib/BasessfGuardAuthActions.class.php:

public function executeSignout()

{ 	
$this-&gt;getUser()-&gt;clearCredentials();

$this-&gt;getUser()-&gt;setAuthenticated(false);
 $this-&gt;getUser()-&gt;getAttributeHolder()-&gt;remove(&#039;referer&#039;);  $this-&gt;getUser()-&gt;getParameterHolder()-&gt;removeNamespace(&#039;referer&#039;);
$this-&gt;getUser()-&gt;getParameterHolder()-&gt;clear();
..
}</description>
		<content:encoded><![CDATA[<p>hi. I try all the suggestions but to no avail. Please help me.</p>
<p>prjname/plugins/sfGuardPlugin/modules/sfGuardAuth/lib/BasessfGuardAuthActions.class.php:</p>
<p>public function executeSignout()</p>
<p>{<br />
$this-&gt;getUser()-&gt;clearCredentials();</p>
<p>$this-&gt;getUser()-&gt;setAuthenticated(false);<br />
 $this-&gt;getUser()-&gt;getAttributeHolder()-&gt;remove(&#8216;referer&#8217;);  $this-&gt;getUser()-&gt;getParameterHolder()-&gt;removeNamespace(&#8216;referer&#8217;);<br />
$this-&gt;getUser()-&gt;getParameterHolder()-&gt;clear();<br />
..<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Thomas Boerger</title>
		<link>http://eatmymonkeydust.com/2008/08/symfony-security-sessions-not-cleared-when-logging-out/comment-page-1/#comment-274</link>
		<dc:creator>Thomas Boerger</dc:creator>
		<pubDate>Wed, 26 Nov 2008 15:20:22 +0000</pubDate>
		<guid isPermaLink="false">http://eatmymonkeydust.com/?p=36#comment-274</guid>
		<description>And if you really want to clear everything that is on session write something like the following to your action:

$this-&gt;getUser()-&gt;getParameterHolder()-&gt;clear()

This call clears everything you have set on $this-&gt;getUser()-&gt;setParameter(&#039;foo&#039;, &#039;bar&#039;)</description>
		<content:encoded><![CDATA[<p>And if you really want to clear everything that is on session write something like the following to your action:</p>
<p>$this-&gt;getUser()-&gt;getParameterHolder()-&gt;clear()</p>
<p>This call clears everything you have set on $this-&gt;getUser()-&gt;setParameter(&#8216;foo&#8217;, &#8216;bar&#8217;)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Thomas Boerger</title>
		<link>http://eatmymonkeydust.com/2008/08/symfony-security-sessions-not-cleared-when-logging-out/comment-page-1/#comment-273</link>
		<dc:creator>Thomas Boerger</dc:creator>
		<pubDate>Wed, 26 Nov 2008 15:04:50 +0000</pubDate>
		<guid isPermaLink="false">http://eatmymonkeydust.com/?p=36#comment-273</guid>
		<description>You never got to manipuilate the session directly.

You&#039;ve got to add session vars with $this-&gt;getUser()-&gt;setAttribute(&#039;varname&#039;, &#039;varvalue&#039;, &#039;yourNamespaceForVars&#039;);

So if you are logging out you got to remove the namespace only and everything is fine.

$this-&gt;getUser()-&gt;getParameterHolder()-&gt;removeNamespace(&#039;yourNamespaceForVars&#039;)


Kind regards,
  Thomas Boerger</description>
		<content:encoded><![CDATA[<p>You never got to manipuilate the session directly.</p>
<p>You&#8217;ve got to add session vars with $this-&gt;getUser()-&gt;setAttribute(&#8216;varname&#8217;, &#8216;varvalue&#8217;, &#8216;yourNamespaceForVars&#8217;);</p>
<p>So if you are logging out you got to remove the namespace only and everything is fine.</p>
<p>$this-&gt;getUser()-&gt;getParameterHolder()-&gt;removeNamespace(&#8216;yourNamespaceForVars&#8217;)</p>
<p>Kind regards,<br />
  Thomas Boerger</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: The Codebelay Blog &#187; Installing sfGuardPlugin in symfony 1.1 &#8212; A Guide for the Perplexed</title>
		<link>http://eatmymonkeydust.com/2008/08/symfony-security-sessions-not-cleared-when-logging-out/comment-page-1/#comment-164</link>
		<dc:creator>The Codebelay Blog &#187; Installing sfGuardPlugin in symfony 1.1 &#8212; A Guide for the Perplexed</dc:creator>
		<pubDate>Mon, 18 Aug 2008 18:39:04 +0000</pubDate>
		<guid isPermaLink="false">http://eatmymonkeydust.com/?p=36#comment-164</guid>
		<description>[...] symfony 1.1 has a signout bug, where sessions are not entirely cleared. Thanks to this blog post, I was able to hack something [...]</description>
		<content:encoded><![CDATA[<p>[...] symfony 1.1 has a signout bug, where sessions are not entirely cleared. Thanks to this blog post, I was able to hack something [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: rpsblog.com &#187; A week of symfony #84 (4-&#38;gt;10 august 2008)</title>
		<link>http://eatmymonkeydust.com/2008/08/symfony-security-sessions-not-cleared-when-logging-out/comment-page-1/#comment-162</link>
		<dc:creator>rpsblog.com &#187; A week of symfony #84 (4-&#38;gt;10 august 2008)</dc:creator>
		<pubDate>Sun, 10 Aug 2008 22:33:51 +0000</pubDate>
		<guid isPermaLink="false">http://eatmymonkeydust.com/?p=36#comment-162</guid>
		<description>[...] Symfony security, sessions not cleared when logging out [...]</description>
		<content:encoded><![CDATA[<p>[...] Symfony security, sessions not cleared when logging out [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Russ</title>
		<link>http://eatmymonkeydust.com/2008/08/symfony-security-sessions-not-cleared-when-logging-out/comment-page-1/#comment-158</link>
		<dc:creator>Russ</dc:creator>
		<pubDate>Tue, 05 Aug 2008 08:16:54 +0000</pubDate>
		<guid isPermaLink="false">http://eatmymonkeydust.com/?p=36#comment-158</guid>
		<description>That&#039;s true, I can imagine there are some cases where you&#039;d want some session values to be remembered even after the user logs out - but then I guess it&#039;s easy enough to reload the required data into the new session, or even just use some additional cookies.</description>
		<content:encoded><![CDATA[<p>That&#8217;s true, I can imagine there are some cases where you&#8217;d want some session values to be remembered even after the user logs out &#8211; but then I guess it&#8217;s easy enough to reload the required data into the new session, or even just use some additional cookies.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

