Jump to content

Object shared across sessions


grayFalcon

Recommended Posts

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

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!

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.