I come here with a simple, yet very important question regarding session security.
I wonder if it's secure to share sessions from PHP back-end with node.js + socket.io to authenticate and authorize WebSocket connections with that data? To share sessions between PHP and node.js I am planning to use Redis.
I've seen many solutions making HTTP requests to PHP back-end to obtain session data, but I find it unnecessary, since I plan to use Redis to store sessions anyway (to allow distributing PHP back-end on multiple servers).
I'm not sure what else information would be relevant, so please do not hesitate to ask.
I think it's also worth mentioning that PHP back-end is server with nginx fastCGI module connecting to PHP-FPM and node will also reside behind nginx. Also both regular PHP and WebSocket connections are using SSL.
Because it seems the question is not clearly stated: Is it wise in terms of security to share sessions using Redis (Memcached or noSQL database, while I'm going to use Redis) and why all tutorials use HTTP requests instead of what seems easier and more performant (is it because of scalability)?