#StackBounty: #node.js #cookies #https setting up https cookie in nodejs

Bounty: 200

I am trying too setup a login system on my website.

Heard that nodejs cookies are a good way to do that.

Here:
https://stackoverflow.com/a/21809393/322537 I have found an example of how https servers are created.
It is my understanding that the createServer function should run every time a client makes a request.

So I have the following in my code:

var server_https=modules.https.createServer({
    key: this.ssl_key,
    cert:this.ssl_cert
    },this.respond_to_client).listen(this.port);


mconnection.prototype.respond_to_client=function(request,response){
    console.log('responded to client');
    }

The server appear to run fine as the website is up and running.
But the respond_to_client function appears to never run as nodejs’s log file never indicates the ‘responded to client’ string.

How could that be?
Could it have something to do with that I’m upgrading the https server to a websocket shortly later in the code?

update:
here is the server file:
https://openage.org/s.js
here is the connection module:
https://openage.org/c.js

and here is the chat program the are serving
https://openage.org/chat/14/?page=index

The plan is to then make cookies to identify clients and then to setup a login system. But I’m stuck at this. /:


Get this bounty!!!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.