Passing Objects from Page to Page

Hello all!
I cannot seem to figure out a way to pass an object from one page to another. Now, my flow may be way off, and if it is, please do advise.
I want to have a form for username/password log in.
When the submit button is hit, it takes those values, finds the matching user in the database, and returns the user object. We’ll call him user_object
Now, I want to bring up another page, that allows user_object to enter in additional information (Event details). After it does this, it writes those Event Objects into the database.

My problem is: I need the ID Object attached to user_object while inserting the Event Objects into the database.
The user_object and Event Objects values are assigned from two separate forms and two separate submit buttons.
How do I pass this information?

I don’t want to use session because I have a lot of objects and do not want to serialize and unserialize all the time. I also read that $_GET is a security risk.

Thanks in advance for any help!

The user_object would be set in the login cookie, right? As a session_name: user_object1, etc.

Then on the next page when the user is keying in the events, couldn’t you set the user_ object as the same name as the cookie? Like $user_object =_objectNAME $row[‘whatever the cookie session name is’];

And when the event object is inserted, the $user data could also.

If your table is something like: user_objectNAME, event_object, etc.

Insert into table whatever $event_object, $user_objectNAME, etc. This way, it’s pulling the user data from the cookie that was set in the login. Would that work?

I am trying to avoid using sessions. I am using MongoDB and code is very object oriented, so staying away from session as much as possible so I don’t have to mess with serializations.

Sponsor our Newsletter | Privacy Policy | Terms of Service