Jump to content

[SOLVED] question about object & sessions..


melvincr

Recommended Posts

i've a basic question if there is any reason not to store a userobject in a session..

 

$tempuser = new cl_user();

$tempuser->LoadById(1);

$_SESSION['userobject'] = serialize($tempuser);

 

i did this to avoid many sql accesses, the object itself contains all security functions like html stripping, size checks..

Link to comment
https://forums.phpfreaks.com/topic/58729-solved-question-about-object-sessions/
Share on other sites

No, just stating that.

 

As for the problem, thats not really a problem at all. I have classes I store in session that uses session variables for verification etc. Never had a problem with it, and I never serialized it. I guess I could but yea.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.