RSS

$SESSION and “Node no longer exists”

07 May

My really dummy php mistake I made yesterday was I tried to write values of SimpleXML object to session and constantly got a “Node no longer exists” error. Spending some time I figured it out of course but if you, reader, faced the same problem then the it can be solved by converting the SimpleXML value to string.

 
    $xml  = new SimpleXMLElement($obj);
    $hotel  = $xml->hotelList->hotelName;
    $_SESSION['hotelName'] = (string)$hotel;

Hope this helps.

Advertisements
 
Leave a comment

Posted by on May 7, 2009 in PHP

 

Tags: , ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: