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
'TypeError: cookie required' when setting custom id #103
Comments
Can you post the full stack trace for that error, please? |
I hope this is what you're after, if not, let me know what you need me to do. Thanks.
|
Thank you, that is exactly what I was looking for :) |
So, really, the only way to that that error is if you are not actually providing the Also, remove that |
Also, can you give the output of |
Yes this is the literal code (I've created a reduced test case to ease confusion). I thought I was providing the name in the session constructor (name: 'test'). I've removed the As requested, here's the result of an
|
Just to humor me real quick, can you do the following:
No problem. The issue with what you had there is there must always be a return value; your code sometimes would return
me too... so I can run your app for sure, but can you provide me the steps i need to take to reproduce the error? is just loading |
OK, I've completed the Here's the new stack trace (hope this one lines up):
navigate to http://localhost:3001/ then enter an email address into the form field and click submit, it should fail at this point. Thanks for your help |
I was able to reproduce :) Now the bug can be squashed! |
Ok, the root cause is because |
i.e. |
Brilliant Doug, I revisited my original implementation (as I knew I wasn't using a number there). I was passing a Could you just check this isn't a mad thing to do. I'm going to set the
Is this what you'd recommend? Thanks for your help and time on this one. David |
As far as your strategy here, to give a good answer, I need to know more about where this session ID is actually coming from. So it seems to me what you're trying to do is create a document in Mongo and then use that document's automatically-generated ID (basically similar to an auto-increment key in a RDBMS) and use that as the session ID, correct? If that is the case, there really is no good answer, at least not until #52 is addressed. |
Hi Doug, just thought I'd say thanks, I hope saying thanks doesn't cause you more work (i.e. reopens this ticket). David |
Hey, so the actual contents of what #52 says is a little misleading for what it's about, but the essence is that you can make the call into mongo and then return the session ID, etc. all from |
I'm trying to use a session ID from my mongo database as the sessionID within express-session and have these details stored within a connect-redis session store.
I keep getting 'TypeError: cookie required'
This appears to be a bug, but could somebody check my logic here please:
I've stripped the code down to it's bare bones and removed anything that's not required to create the issue.
The text was updated successfully, but these errors were encountered: