You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A standard sign-in page will return authentication details (e.g. JWT) in the cookies header of the 302 (redirect) response, which can then be used to validate requests to access secure pages.
Testing such behaviour with fetch() using redirect:follow (and credentials:include) fails in Deno, as fetch() doesn't retain the cookies from the 302 response and supply them in the subsequent GET request.
The Deno user agent does not have a cookie jar. As such, the set-cookie header on a response is not processed, or filtered from the visible response headers.
Existing threads about this exist: #5862, and there doesn't seem to be a clear answer on whether to implement a cookie jar or not. Ryan Dahl said
I agree. Deno ought to behave exactly as a browser does when it comes to the fetch() API.
…back in May 25, 2020. But since then there's been no updates on the front, and given it's now documented, it may be that the deno team has changed their minds on the matter.
Version: Deno 2.1.1
A standard sign-in page will return authentication details (e.g. JWT) in the cookies header of the 302 (redirect) response, which can then be used to validate requests to access secure pages.
Testing such behaviour with
fetch()
usingredirect:follow
(andcredentials:include
) fails in Deno, asfetch()
doesn't retain the cookies from the 302 response and supply them in the subsequent GET request.Steps to reproduce:
I think retaining cookies should be default behaviour, but if not, is there some option that can be set to facilitate cookie retention?
Thanks
The text was updated successfully, but these errors were encountered: