New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cookie question #62
Comments
|
The app is still working as expected. I'm using express 4.5.1 and express-session 1.6.4 |
Can you post a gist that reproduces the issue? |
I found the issue (I'm relatively new to express). I had not declared req.headers.cookie. I added a line req.headers.cookie = null; and that solved the issue. I guess it was not able to access it because it didn't exist. Thanks for your time. |
Its strange that |
Here's the relevant snippet from my app.js. As I said I'm new to express so I may have a glaring mistake I just don't have the intuition to catch. app.use(function(req, res, next) {
req.db = db.db;
req.encoder = new Encoder('entity');
req.session = null;
req.headers.cookie = null;
next();
});
app.use(partials());
app.use(cookieParser());
app.use(session({
secret: ''+new Date().getTime(),
cookie: {secure: false},
resave: true,
saveUninitialized: true
}));
app.set('port', process.env.PORT || defaultPort);
app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'ejs');
app.use(logger('dev'));
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({extended: 'false'}));
app.use(express.static('public'));
app.use(express.static(path.join(__dirname, 'public'))); |
You shouldn't be doing anything to |
The warning is because your secret is
@joewagner it made the issue so away because it removed the cookies, essentially, so the module was no longer confused from having an invalid secret. |
Thanks for the help! |
When handling a GET request with my express router, I get the following error:
I do not know what I am doing wrong. Help would be appreciated!
Levi
The text was updated successfully, but these errors were encountered: