Session breaks Entity API
Variables are serialised (as are session writes as I understand it), and complex objects like entity API entities don't serialise well.

The better solution would be to store the entity type and ID in the session, then load it when reading:

$_SESSION['saved_entity'] = array('type' =&gt; 'node', 'id' =&gt; 1);

...

$saved_entity = entity_load($_SESSION['saved_entity']['type'], array($_SESSION['saved_entity']['id']));


And do the same thing for the variables.