Note that there are some explanatory texts on larger screens.

plurals
  1. POSharing data between php and node.js via cookie securely
    primarykey
    data
    text
    <p>I have a PHP site, and for real time updates and chat I have installed Node.js and its running fine.</p> <p>Both PHP and Node.js have access to the same MySQL database.</p> <p>But the problem is to verify the identity of an user, who is already logged in to the PHP site.</p> <p>I don't want to talk to the PHP app via any means, REST or not. As, to me this will defeat the same purpose of using Node.js, as then each Node.js request, a new PHP page request would be made. </p> <p>What I want is, a encryption and decryption method which is understood by both PHP and node.js</p> <p>So that I can set a cookie with the encrypted value for Node.js request, which will be at updates.mydomain.com subdomain. By reading the cookie, Node.js can decrypt its value and verify the user's identity.</p> <p>So, my question: is there any encrypt and corresponding decrypt method that is supported via both PHP and Node.js, using same encryption key?</p> <p><strong>Updates</strong></p> <p>Actually i m not looking forward to decrypt it on client side :D as then the whole point of decryption is pointless. What i want to do is- </p> <p>1) PHP to generate a cookie encrypted user info and use that cookie for a specific domain like updates.mydomain.com </p> <p>2) Then node.js will get the cookie for each subsequent request, and decrypt the data on server side, using the same encryption key.</p> <p>As u can see, that is why i wanted to know, if there is a common encryption/decryption system between PHP and node.js, so that encrypted data by one can be decrypted by the other and vice versa.</p> <p>This way i can securly transfer the current logged in users identity from PHP to node.js and i don't have to worry about session management of other kinds :)</p> <p>So in short, Encrypt by PHP -> Decrypt by Node.js -> get back same data. Possible?</p> <p>Thanks,<br> Anjan</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload