I have an app developed entirely with PHP and now I want to integrate RTN (Real Time Notification System) in my app. Currently I have accomplished connecting to Node.js after page rendered by PHP with this code
SERVER:
var app = http.createServer(function(request,response)
{
response.writeHead(200,{"Content-Type":"text/plain"});
response.end();
}).listen(3000);
var io = require('socket.io').listen(3000);
CLIENT
<script src="http://localhost:3000/socket.io/socket.io.js"></script>
<script>
var socket = io.connect('http://localhost:3000');
socket.on('news', function (data) {
console.log(data);
socket.emit('my other event', { my: 'data' });
});
</script>
but now getting puzzled that how can I get the Request Header of client request? Actually I want to get Client Cookie using PHP for development and Node for RTN system. Now as I don't know how to get Request Header sot unable to get cookie as well :(
UPDATED I am using Memcache for storing Sessions and this is the main reason I want to get cookie so that I can get session information of PHP
3000?