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
API proxy seems to not forward cookies #148
Comments
hmm, shouldn't be, we used and tested this with comverge extensively given we were authenticating against devise which depends on cookies being set. |
figured out this just needs app.use(express.cookieParser()) to be added. Not sure if this is something you want to add in lineman's server.coffee or if the user config should add it as the first line in the drawRoutes method. The problem was just that it's not ending up in req.cookies, not that the cookies weren't in the header. |
@searls @davemo FYI, we cannot add express.cookieParser() in our config/server as the infrastructure stands now. I've tried adding it, and it does nothing. I'm guessing this is because we have to Alternatively, the problem could be the order of calls. Maybe by the time control is passed to drawRoutes, other middleware has been set such that cookieParser can no longer work. In that case, you could either (again) just always set it yourself or add a second call earlier in the middleware definition to something like But a solution would be useful because right now, we're doing this: var sessionStr = /manta_session=([^;]*)/.exec(req.header('Cookie'))[1];
var manta_session = JSON.parse(decodeURIComponent(sessionStr)); which is kind of loud and error prone. |
👍 let's look into this On Fri, Feb 28, 2014 at 9:55 AM, Andrew Nichols notifications@github.comwrote:
|
Seems like HTTP cookies are getting eaten up by our API proxy.
Reported by @faktorsmak
The text was updated successfully, but these errors were encountered: