grayFalcon Posted January 10, 2007 Share Posted January 10, 2007 Hello everybody!Maybe this is a stupid question, but I have an object that needs quite a while to be constructed and it needs to be polled quite often. Would it be possible to create this object once at the first request and keep it in memory across different request and accessible from different scripts?Thanks a lot in advance! Link to comment https://forums.phpfreaks.com/topic/33612-object-shared-across-sessions/ Share on other sites More sharing options...
trq Posted January 10, 2007 Share Posted January 10, 2007 You could store it within the $_SESSION array. Link to comment https://forums.phpfreaks.com/topic/33612-object-shared-across-sessions/#findComment-157679 Share on other sites More sharing options...
grayFalcon Posted January 10, 2007 Author Share Posted January 10, 2007 Not really... unless I misunderstand the way $_SESSION works. I need to have session handling too, but I need different clients to use the same object, meaning that I need to access it from different sessions, without having to build it separately for each session. Partly because building it is so expensive that I don't want to do it once per session, and partly because, if it changed, I need it to change across all sessions.Or can I "abuse" $_SESSION to do something like that?Thanks a lot in advance! Link to comment https://forums.phpfreaks.com/topic/33612-object-shared-across-sessions/#findComment-157691 Share on other sites More sharing options...
utexas_pjm Posted January 10, 2007 Share Posted January 10, 2007 I hope I am wrong, but I think the only way you will be able to achieve this is with serialization and some sort of persistent medium i.e., database, flatfile, etc.Best,Patrick Link to comment https://forums.phpfreaks.com/topic/33612-object-shared-across-sessions/#findComment-157709 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.