<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1042167" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1042167</link>
    <description></description>
    <language>en</language>
          <item>
    <title>This is one of those</title>
    <link>https://www.webmaster-forums.net/web-programming-and-application-development/saving-object-session#comment-1234605</link>
    <description> &lt;p&gt;This is one of those subjects where I&#039;d like to hear Abhi&#039;s opinion too. &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/smile.png&quot; title=&quot;Smiling&quot; alt=&quot;Smiling&quot; class=&quot;smiley-content&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Serialising methods isn&#039;t harmful, but storing a whole user class instance is a little inefficient. Most user state information should already be recorded in the database, pretty-much all you need in &lt;code&gt;$_SESSION&lt;/code&gt; is the user id, a datestamp of when they performed their last action (if you want a who&#039;s online widget), and other stuff relating to &lt;em&gt;just this session&lt;/em&gt;, a message to display to the user, for example.&lt;/p&gt;
&lt;p&gt;I tried this out myself, and PHP sensibly just stored the object&#039;s state, i.e. it guessed what I wanted and did it. So, what you&#039;re doing is convenient, but it is possibly storing a little more information than you need. &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/smile.png&quot; title=&quot;Smiling&quot; alt=&quot;Smiling&quot; class=&quot;smiley-content&quot; /&gt;&lt;/p&gt;
 </description>
     <pubDate>Tue, 28 Oct 2008 14:16:38 +0000</pubDate>
 <dc:creator>JeevesBond</dc:creator>
 <guid isPermaLink="false">comment 1234605 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title>I&#039;m not sure why you would</title>
    <link>https://www.webmaster-forums.net/web-programming-and-application-development/saving-object-session#comment-1234537</link>
    <description> &lt;p&gt;I&#039;m not sure why you would want to store an object with methods.  I sometimes store profile information (user id, email, whatever) in the session, but it would be an assoc array or data object.&lt;/p&gt;
&lt;p&gt;All other things I store are just variables.&lt;/p&gt;
 </description>
     <pubDate>Mon, 27 Oct 2008 01:30:55 +0000</pubDate>
 <dc:creator>pr0gr4mm3r</dc:creator>
 <guid isPermaLink="false">comment 1234537 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title>Methods (most of them could</title>
    <link>https://www.webmaster-forums.net/web-programming-and-application-development/saving-object-session#comment-1234536</link>
    <description> &lt;p&gt;Methods (most of them could be removed since they are just accessors) and values. Why do you ask?&lt;/p&gt;
&lt;p&gt;And if you&#039;re not putting objects in sessions, how do you manage state data (besides putting each piece of data into a separate session var)? Are you manually serializing it? Are you keeping everything in a database with the sessionID as the primary key?&lt;/p&gt;
 </description>
     <pubDate>Mon, 27 Oct 2008 01:09:09 +0000</pubDate>
 <dc:creator>teammatt3</dc:creator>
 <guid isPermaLink="false">comment 1234536 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title>In other languages, the</title>
    <link>https://www.webmaster-forums.net/web-programming-and-application-development/saving-object-session#comment-1234535</link>
    <description> &lt;p&gt;In other languages, the objects had to be serializable, I think.  In PHP, I think as long as the object isn&#039;t anything to do with something instance-based, like a MySQL connection, you&#039;re fine.&lt;/p&gt;
&lt;p&gt;Does your object just have values, or are there any methods?&lt;/p&gt;
 </description>
     <pubDate>Mon, 27 Oct 2008 00:42:03 +0000</pubDate>
 <dc:creator>pr0gr4mm3r</dc:creator>
 <guid isPermaLink="false">comment 1234535 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
