[feature] Add method to get cookie (to be used for request in tests)
nanorobocop opened this issue · 2 comments
Is your feature request related to a problem? Please describe.
Currently session.Save()
only saves cookie (via Set-Cookie
) to response.
That's completely fine for actual server handler code.
But there seems no way to get signed cookie to use it for request in tests.
Describe the solution you'd like
Add separate method, like Store.GetCookie()
, that could be used for request in tests.
Describe alternatives you've considered
Alternative would be to have test handler to extract cookie from Set-Cookie
header.
Do you have an example of code that would use the proposed method GetCookie()
? When you say "tests", I'm assuming unit tests for an application?
I figured it out to use gorilla/securecookie directly.
My use case actually more related to that package.