Skip to content

Commit

Permalink
express-session
Browse files Browse the repository at this point in the history
  • Loading branch information
asifgenius committed Jan 3, 2023
1 parent 4ea5412 commit a92c293
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion server.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,16 @@ app.use(cookieParser());

//Set statuc folder
app.use(express.static(path.join(__dirname, 'public')));

/*
1. express-session accepts some properties.It is given below:
cookie,
cookie.domain,
cookie.expires
2. Cookie is a settings object which is the session ID cookie. Session data is not saved in the cookie itself, just the session ID. Session data is stored server-side.
3. Specifies the value for the Domain Set-Cookie attribute and cookie.expires properties have specifies the Date object to be the value for the Expires Set-Cookie attribute.
4. Since version 1.5.0, the cookie-parser middleware no longer needs to be used for this module to work.
5. This module now directly reads and writes cookies on req/res. Using cookie-parser may result in issues if the secret is not the same between this module and cookie-parser.
*/
//Express Session
app.use(expressSession({
secret: 'secret',
Expand Down

0 comments on commit a92c293

Please sign in to comment.