Tuesday 23 May 2017

Cookie Jar from requests package resets on page redirect

When I redirect from login.html to index.html, the custom cookie jar does not persist. When I set up a post request, I did this almost verbatim: node.js cookie with request.jar, and can clearly see that I have a cookie in the cookie jar prior to redirection.

However, after I do window.location.href = 'index.html' and console.log the cookie jar, it says the cookie jar is completely empty and the cookie that was present before redirection is not there anymore.

Does anyone have any experience w/ this? I'm including a jar.js with the exact same functions as in the above mentioned post, and calling them the same way.



via George Jiang

No comments:

Post a Comment