I'm planning to run my existing Zend Framework 2 application using ReactPHP and so far it's going well, but I have troubles with sessions handling.
So far I'm using this ReactPHP module for ZF2 which is letting me run my project very easy.
I guess that I cannot use session_*
functions, because they would work globally on all requests.
I already use Ratchet for the web sockets and I'm loading the session from MongoDB by simply getting the session ID from the cookies, which are sent with headers on each web socket connection. However if I want to make it similar with my whole application using ReactPHP as http server, I'll need to generate my own session ids, manually create session cookies using the response object. Is this a good approach?
My primary concerns are the generation of the session ID and the cookie, also the security aspects of this manual approach too.