Last active
September 5, 2017 13:54
-
-
Save conanak99/760bc19a93aec1c900762dd42c333f1a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app.get("/", function (request, response) { | |
if (!request.cookies.id) { | |
const randomId = idGenerator.getRandomId(); | |
response.cookie('id', randomId , { maxAge: 30*24*3600*1000 } ); // Cookie 30 ngày | |
} | |
response.sendFile(__dirname + '/views/index.html'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment