Storing PHP Object in session

General discussions related to php

Moderators: macek, egami, gesf

Post Reply
johnj
php-forum Super User
php-forum Super User
Posts: 1805
Joined: Thu Mar 10, 2011 5:07 pm

Re: Storing PHP Object in session

Post by johnj » Wed Jun 27, 2012 5:30 am

Thought I am not an expert on this topic, my limited knowledge tells me that storing an object in a session variable is not a good practice for a variety of reasons.

But, you can try this: serialize the object before storing to session variable and unserialize it after you get it from the session. Read about serialize and unserialize from php.net.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests