Wamp routers like Crossbar are not going to manage your PHP sessions for you. You might still be able to access your PHP sessions, but you’ll have to do it by writing a custom session handler.
Wamp routers will allow you to authenticate (probably you will use ticket authentication or CRA). After you authenticate, the wamp router will know your authid or have some token that can be mapped to your backend user. You’ll need to tell wamp to “disclose_caller” when you invoke RPC on your PHP backend and then using that wamp authid or wamp token, you can then find the session data for the user, load it in a PHP object and use it for your request.
You’ll want to be careful, however … because in PHP with Apache, the $_SESSION variable comes into existence when your page loads and is destroyed when the script ends. When you are using PHP with Thruway, your PHP application is running non-stop, so if you create a $_SESSION variable, it will not be auto-destroyed on the next function call. You’ll likely want to have “session” objects that load data in a non-global way (remember $_SESSION is considered a super-global). Something like $session_data = new Com/Example/Session( $wamp_auth_id) is what you’ll need to build.
On Wednesday, February 11, 2015 at 5:34:17 PM UTC-6, Eugen Kandakov wrote:
i used to build a small application with ratchet and implemented the SessionProvider found here: http://socketo.me/docs/sessions
After switching to AutobahnJS in the browser frontend, i realized ratchet does not implement WAMP v2, so i switched to crossbar.io and thruway and use it with my php backend.
In my application the user signs in and gets a simple PHP-Session with his information. I could not find out how to access this PHP-Session information. Is there any example or tutorial i can work through?
With ratchet i used the MemcachedSessionHandler as session storage on the web server and websocket server.
Thanks for the help and suggestions