Tuesday 30 April 2019

Problems with saving changes to a session before redirect

I had a problem before where I'd try to make changes to req.session, and I'd get this error: "Can't set headers after they are sent."I found out that res.redirect was causing my issues, even though it's after req.session.x = y ... it's being called first, and I haven't been able to resolve it. I called req.session.save with the redirect inside the callback after making changes to req.session, but no dice.

Submitted May 01, 2019 at 12:36AM by Mobile_Monk

No comments:

Post a Comment