: How do I disable socket.io cookie named io server-side? I needed to disable the socket.io cookie named io server-side. I follow the path to file creating the cookie to a file located at C:socket.ioexampleschatnode_modules
I needed to disable the socket.io cookie named io server-side.
I follow the path to file creating the cookie to a file located at
C:socket.ioexampleschatnode_modulessocket.ionode_modulesengine.iolibserver.js
Which lines do I need to remove?
More posts by @Bryan171
2 Comments
Sorted by latest first Latest Oldest Best
Just pass an option to do it:
var io = require('socket.io')();
io.on('connection', function(client){});
io.listen(3000, {
cookie: false
});
See it in the docs: github.com/socketio/engine.io#methods-1
I removed the lines below and it removed the cookie
line 14
//var cookieMod = require('cookie');
line 47
//this.cookie = false !== opts.cookie ? (opts.cookie || 'io') : false;
line 48
//this.cookiePath = false !== opts.cookiePath ? (opts.cookiePath || '/') : false;
line 49
//this.cookieHttpOnly = false !== opts.cookieHttpOnly;
line 290 - line 298
//if (false !== this.cookie) {
//transport.on('headers', function (headers) {
//headers['Set-Cookie'] = cookieMod.serialize(self.cookie, id,
//{
//path: self.cookiePath,
//httpOnly: self.cookiePath ? self.cookieHttpOnly : false
//});
//});
//}
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.