javascriptjquerynode.jsnowjs-sockets

Getting session cookie with jQuery security


Are there any security issues with getting a cookie with jquery and sending it via nowjs function as opposed to getting it via the request on the server?

var session = $.cookie('session_cookie');

now.distributeMessage(session);

vs

req.headers.cookie

Solution

  • I don't see the reason to send cookies from the browser side, since they are transmitted either way each time you make a request to the server. No need to duplicate this feature, just use:

    req.headers.cookie