title: PHP: Storing 'objects' inside the $_SESSION
body: <p>I just figured out that I can actually <strong>store objects in the $_SESSION</strong> and I find it quite cool because when I jump to another page I still have my object. Now before I start using this approach I would like to find out if it is really such a good idea or if there are <strong>potential pitfalls</strong> involved. </p>
  
  <p>I know that if I had a single point of entry I wouldn't need to do that but I'm not there yet so I don't have a single point of entry and I would really like to keep my object because I don't lose my state like that. (Now I've also read that I should program stateless sites but I don't understand that concept yet.)</p>
  
  <p>So <strong>in short</strong>: Is it ok to store objects in the session, are there any problems with it?</p>
  
  <hr>
  
  <p>Edit:</p>
  
  <p><em>Temporary summary</em>: By now I understand that it is probably <strong>better to recreate</strong> the object even if it involves querying the database again. </p>
  
  <p>Further answers could maybe <strong>elaborate on that aspect</strong> a bit more!</p>