Abdullah Al Shakib
Abdullah Al Shakib

Reputation: 2044

Read PHP Session data in node.js

I am working on a project in php and node.js. I have some data in session like

[user]= ARRAY([0]=> stdClass Object([username] => XXX, [app_id] -> XXX))

Now i want to read app_id from session and need to use in node.js like

var myquery =
            "SELECT count(cs.id ) AS new_message " + 
            "FROM dcms_corr_status as cs " +
            "LEFT JOIN `dcms_user` as u ON `u`.`appointment_ref_no` = `cs`.`appointment_ref_no` "+
            "WHERE `cs`.`appointment_ref_no` = '" + user_app +"' AND `cs`.`isread` = 0 " +
            "AND `cs`.`action_or_info` = 1";
var query = connection.query(myquery),

where user_app is my session data.

How can i do that?

Upvotes: 1

Views: 1298

Answers (1)

mscdex
mscdex

Reputation: 106726

If you really want to parse a PHP session file in node you could try groan. Otherwise you might look into using MySQL, memcached, or Redis for your session storage instead.

Upvotes: 2

Related Questions