2

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.

Deduplicator
  • 44,692
  • 7
  • 66
  • 118
  • I have a similar Laravel Project. I am using Laravel's session service provider configured to use redis as session storage. The approach you are using is in my opinion is the best solution. However using components that has been tested would be advisable. – Arun Poudel Apr 16 '15 at 20:24

0 Answers0