I am trying too setup a login system on my website.
Heard that nodejs cookies are a good way to do that.
In the following links:
https://stackoverflow.com/a/21809393/322537
https://nodejs.org/dist/latest-v8.x/docs/api/https.html
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?
The plan is to then make cookies to identify clients and then to setup a login system. But I'm stuck at this. /: