jscix Posted May 24, 2008 Share Posted May 24, 2008 I'm curious if anyone knows of any reason why persisting an object in a session could be a bad idea? Besides memory usage, and if anyone can answer this, how much memory usage would I be looking at by storing an object in a session? The object is merely a storehouse for user related data. (name, address, phone#, etc.) It also contains a few methods for manipulating that data.. Thanks in advance. Link to comment https://forums.phpfreaks.com/topic/107023-a-quick-question/ Share on other sites More sharing options...
minidak03 Posted May 24, 2008 Share Posted May 24, 2008 Most of the time its not nessissary to do this because you won't need the entire object you'll just need there name for instance in which case you just store there name in the session. Also another reason not to do it is because sometimes you won't need to use sessions on all pages but you may need to access the object on that page, by storing that entire object in a session you'll have to re-open the session to get at it. Not the best argument in the book but you can also loose that session data with Internet Explorer and boom there goes your object, it makes it hard to troubleshoot through your code. Link to comment https://forums.phpfreaks.com/topic/107023-a-quick-question/#findComment-548716 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.