Browse Source

meh

master
Rich Brown 1 year ago
parent
commit
9f58ed6be0
1 changed files with 4 additions and 3 deletions
  1. +4
    -3
      src/index.js

+ 4
- 3
src/index.js View File

@@ -1,5 +1,5 @@
import express from 'express';
import session from 'cookie-session';
import cookieSession from 'cookie-session';
import cors from 'cors';
import compression from 'compression';
import path from 'path';
@@ -17,14 +17,15 @@ const port = 8086;

const app = express();

app.use(session({
app.set('trust proxy', 1); // trust first proxy
app.use(cookieSession({
name: 'post-session',
keys: process.env.KEYS,
maxAge: 1000 * 60 * 2, // 2 hours, matches elsewhere
}));

app.use((req, res, next) => {
console.log(req.session.views, req['post-session']);
console.log(req.session);
next();
});



Loading…
Cancel
Save