News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Gonzalo Ayuso's Blog:
Using node.js to store PHP sessions
July 25, 2011 @ 11:43:45

Gonzalo Ayuso has an interesting new post today looking at how to go cross-technology in your application and store your PHP sessions in a basic Node.js instance.

We use sessions when we want to preserve certain data across subsequent accesses. PHP allows us to use different handlers when we're using sessions. The default one is filesystem, but we can change it with session.save_handler in the php.ini. session.save_handler defines the name of the handler which is used for storing and retrieving data associated with a session. We also can create our own handler to manage sessions. In this post we're going to create a custom handler to store sessions in a node.js service.

He includes the full code you'll need (also here on github) to make a custom session handling class on the PHP side and some simple unit tests done on the Node.js side to ensure for proper handling and garbage collection.

0 comments voice your opinion now!
nodejs session handler custom serialize unittest


blog comments powered by Disqus

Similar Posts

Gonzalo Ayuso's Blog: Real time monitoring PHP applications with websockets and node.js

Rob Morgan's Blog: Howto Log Directly to Your OS X Terminal using Zend Framework and NodeJS

NetTuts.com: Refactoring Legacy Code: Part 5 - Game's Testable Methods

Debuggable Blog: How To Execute Only Specific Test Methods in CakePHP Unit Tests

Kevin Schroeder's Blog: Encrypted session handler


Community Events

Don't see your event here?
Let us know!


series api framework yii2 project example language list interview php7 application opinion configure part2 composer introduction podcast laravel symfony community

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework