<?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 fix the __PHP_Incomplete_Class Object error in PHP $_SESSION&#8217;s</title>
	<atom:link href="http://www.crainbandy.com/programming/php/how-to-fix-the-__php_incomplete_class-error-in-php-_sessions/feed" rel="self" type="application/rss+xml" />
	<link>http://www.crainbandy.com/programming/php/how-to-fix-the-__php_incomplete_class-error-in-php-_sessions</link>
	<description>For Web Developers</description>
	<lastBuildDate>Sun, 18 Jul 2010 21:01:27 -0400</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: PHP Autoloader</title>
		<link>http://www.crainbandy.com/programming/php/how-to-fix-the-__php_incomplete_class-error-in-php-_sessions/comment-page-1#comment-2358</link>
		<dc:creator>PHP Autoloader</dc:creator>
		<pubDate>Sun, 16 May 2010 11:55:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.crainbandy.com/?p=796#comment-2358</guid>
		<description>As mentioned above. An Autoloader implementation will repair this error.</description>
		<content:encoded><![CDATA[<p>As mentioned above. An Autoloader implementation will repair this error.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pies</title>
		<link>http://www.crainbandy.com/programming/php/how-to-fix-the-__php_incomplete_class-error-in-php-_sessions/comment-page-1#comment-2328</link>
		<dc:creator>Pies</dc:creator>
		<pubDate>Tue, 16 Mar 2010 18:13:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.crainbandy.com/?p=796#comment-2328</guid>
		<description>The easiest workaround is to define my __autoload() function before session_start(). This way the appropriate classes are loaded when needed.</description>
		<content:encoded><![CDATA[<p>The easiest workaround is to define my __autoload() function before session_start(). This way the appropriate classes are loaded when needed.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Originative</title>
		<link>http://www.crainbandy.com/programming/php/how-to-fix-the-__php_incomplete_class-error-in-php-_sessions/comment-page-1#comment-2315</link>
		<dc:creator>Originative</dc:creator>
		<pubDate>Fri, 01 Jan 2010 14:42:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.crainbandy.com/?p=796#comment-2315</guid>
		<description>in my experience PHP sucks... it is not for programmers it is for children to play with.......</description>
		<content:encoded><![CDATA[<p>in my experience PHP sucks&#8230; it is not for programmers it is for children to play with&#8230;&#8230;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bryan</title>
		<link>http://www.crainbandy.com/programming/php/how-to-fix-the-__php_incomplete_class-error-in-php-_sessions/comment-page-1#comment-2297</link>
		<dc:creator>bryan</dc:creator>
		<pubDate>Thu, 17 Dec 2009 04:26:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.crainbandy.com/?p=796#comment-2297</guid>
		<description>It&#039;s just annoying.</description>
		<content:encoded><![CDATA[<p>It&#8217;s just annoying.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: outis</title>
		<link>http://www.crainbandy.com/programming/php/how-to-fix-the-__php_incomplete_class-error-in-php-_sessions/comment-page-1#comment-2296</link>
		<dc:creator>outis</dc:creator>
		<pubDate>Wed, 16 Dec 2009 02:25:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.crainbandy.com/?p=796#comment-2296</guid>
		<description>Normally, you wind up with an __PHP_Incomplete_Class in $_SESSIONS when the *class* isn&#039;t defined before calling session_start(), rather than when an object isn&#039;t instantiated. The reason is PHP unserializes everything in the session storage; if a class isn&#039;t defined, it unserializes it into a __PHP_Incomplete_Class.

I suspect the reason the fix worked was because you also first serialized the user, and thus unserialize it, probably after the class is defined. You&#039;re getting the __PHP_Incomplete_Class error when accessing $_SESSION[&#039;user&#039;], rather than in the script that performs the authentication, correct?</description>
		<content:encoded><![CDATA[<p>Normally, you wind up with an __PHP_Incomplete_Class in $_SESSIONS when the *class* isn&#8217;t defined before calling session_start(), rather than when an object isn&#8217;t instantiated. The reason is PHP unserializes everything in the session storage; if a class isn&#8217;t defined, it unserializes it into a __PHP_Incomplete_Class.</p>
<p>I suspect the reason the fix worked was because you also first serialized the user, and thus unserialize it, probably after the class is defined. You&#8217;re getting the __PHP_Incomplete_Class error when accessing $_SESSION['user'], rather than in the script that performs the authentication, correct?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cheruvattil</title>
		<link>http://www.crainbandy.com/programming/php/how-to-fix-the-__php_incomplete_class-error-in-php-_sessions/comment-page-1#comment-2275</link>
		<dc:creator>cheruvattil</dc:creator>
		<pubDate>Fri, 30 Oct 2009 12:05:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.crainbandy.com/?p=796#comment-2275</guid>
		<description>we can resolve this by giving a reference to the class which we are trying to unserialize.

class TwitterTweets
{
	var $tweets;
	var $image;
	var $accName;
	function __construct($tweet, $name, $image)
		{
			$this-&gt;tweets	= $tweet;
			$this-&gt;image	= $image;
			$this-&gt;accName	= $name;
		}
	}
// if we are not having any reference we need to give a erference
// $tweetRaw[&#039;tweets&#039;] - serialized class
$serTweetObj = unserialize($tweetRaw[&#039;tweets&#039;]);</description>
		<content:encoded><![CDATA[<p>we can resolve this by giving a reference to the class which we are trying to unserialize.</p>
<p>class TwitterTweets<br />
{<br />
	var $tweets;<br />
	var $image;<br />
	var $accName;<br />
	function __construct($tweet, $name, $image)<br />
		{<br />
			$this-&gt;tweets	= $tweet;<br />
			$this-&gt;image	= $image;<br />
			$this-&gt;accName	= $name;<br />
		}<br />
	}<br />
// if we are not having any reference we need to give a erference<br />
// $tweetRaw['tweets'] &#8211; serialized class<br />
$serTweetObj = unserialize($tweetRaw['tweets']);</p>
]]></content:encoded>
	</item>
</channel>
</rss>
