Skip to content

Instantly share code, notes, and snippets.

@conanak99

conanak99/index.js

Last active Sep 5, 2017
Embed
What would you like to do?
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