I have a website made using php and one part of it is written in node js. The node js server and php share the mysql database. One part of my website is using nodejs which requires that I pass the user id from client side to node js server.
for example I am doing something like this
var user_id=parseInt(<?php echo $this->id; ?>);
The php part is in zend. so for those unfamiliar with zend this id is set in the controller for this particular view.
So when i view the source for this particular page the user id is clearly visible and if changed, a user can make changes to some tables in the database of another user if he passes some other user id instead of his.
What is the best way to hide this variable or some other approach which will help me overcome this issue ?