Open KallDrexx opened 6 years ago
You're right @KallDrexx, cookies should be re-used automatically. We'll need to investigate.
I can still see this issue in Artillery: 1.6.0-29
Hi, I have issue near by this. I need artillery NOT to remember cookies. because I want to send request with same cookies, and ignore one that in response, bu artillery add one that is in the response for me And my one. So I'm getting 2 keys with different value in one request.
I am still having this issue. Where a "Set-Cookie" is not being set
This issue appears to still be present in 1.6.1, node.js v13.8.0.
Any news on this issue ?
Would love a reproducible test case to help isolate the issue. As it stands it's hard to try to identify what it might be. Artillery's test suite contains tests that check that cookies are set and sent on subsequent requests as expected, so the issue might only show up under certain conditions, or with a particular server/framework. Any more information would be appreciated.
I'm facing this issue with http-only
type of cookie (seems also the case of the original poster). The api sends the following cookie:
# copy-pasted from artillery debug logs
http:response "refreshToken=90d237d9c8a1d6560ad921294e0e97ea; Path=/graphql; Expires=Wed, 24 Mar 2021 21:14:43 GMT; HttpOnly; Secure; SameSite=None"
The cookie is not present in the subsequent artillery request. I mention the http-only
type because I'm suspecting that the issue could come from this...
thank you @ben-girardet, the test suite sets HttpOnly
but with SameSite=Strict
so that's one possible route of investigation!
I am encountering this exact same issue, and it appears that only samesite=strict cookies are used in subsequent calls when using http-only cookies:
http:response "Identity.External=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/; secure; samesite=none; httponly",
http:response ".AspNetCore.Antiforgery.g24zGvIGEcc=CfDJ8NV1-Q10eKZGgzDURlu0fOOtASAKZl0oueHav0F9lgWK1qgGrv0g5b1uHfgwAolAq8TXggoRAnSGu4XVgeuyaKeBD-6CPddyzW2w6eLY7IOkIWKl-VdBKg9ebtywz6gwa8crUv6hsZ5ELDSyd3YqIcQ; path=/; samesite=strict; httponly",
http:response ".AspNetCore.Mvc.CookieTempDataProvider=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/; samesite=lax; httponly" ]
Yet in the headers of the request following this, it appears only the samesite=strict; httponly
cookie is set:
RequestJar {
_jar:
CookieJar {
enableLooseMode: true,
store:
{ idx: { my.app.com':
{ '/':
{ '.AspNetCore.Antiforgery.g24zGvIGEcc':
Cookie=".AspNetCore.Antiforgery.g24zGvIGEcc=CfDJ8NV1-Q10eKZGgzDURlu0fOOtASAKZl0oueHav0F9lgWK1qgGrv0g5b1uHfgwAolAq8TXggoRAnSGu4XVgeuyaKeBD-6CPddyzW2w6eLY7IOkIWKl-VdBKg9ebtywz6gwa8crUv6hsZ5ELDSyd3YqIcQ; Path=/; HttpOnly; samesite=strict; hostOnly=true; aAge=30ms; cAge=34ms" } } } } } }
I'm not an expert about cookies... but this could come from Artillery origin
when sending request. I'm testing a node API with artillery and the request coming into node have no origin
set. For a proper evaluation of a strict sameSite it should be able to compare the origin of the request (from Artillery) and the host of the API.
What's strange to me is that origin and host are different (because the host is set but not the origin) but it only works with sameSite strict... I don't get that.
But I confirm what @Ivan-Cristian says: I've tried the exact same setup but with SameSite=Strict and the cookie is well replayed with artillery.
Great detective work folks!🕵️♂️ This is heaps of information for debugging and is very promising! I 💜 this community!
@ben-girardet @Ivan-Cristian Could you confirm that when you run Artillery tests and SameSite=None
cookies aren't being replayed, the server runs on HTTPS? SameSite=None
also requires the Secure
attribute to be set, so the cookie will only be sent over HTTPS connections.
https://developers.google.com/search/blog/2020/01/get-ready-for-new-samesitenone-secure
@Ivan-Cristian I can reproduce the behaviour with SameSite=None
and Strict
when the server does not use HTTPS (this would be the expected behaviour). However, I'm unable to reproduce the issue with samesite=lax
as in your example. If a cookie is set with SameSite=Lax
and no secure
attribute, Artillery is replaying it as expected.
using version 2.0, I have an authentication post request in a scenario that is correctly saving and replaying the returned cookie for all subsequent requests in the flow, but if I move that authentication post to the before
section of the overall script, the cookies are not sent. is this expected?
hi @johnoraclestites 👋 that behavior is indeed expected. cookies would be considered virtual user-specific data and as such do not get passed from a before
block to individual VUs.
Was this ever resolved? I have a request that relies on a cookie being set from a previous requests set-cookie header value but haven't been able to get it working. For comparison, modeling the exact same flow through a series of axios requests works fine.
I couldn't find a topic that is more related to the problem I am struggling with so I decided to write a question here as the thread is still open. One of the responses has 'set-cookie' value in its header which is used by default in cookies in the next request in the flow. Seems like Artillery ignores my custom settings from the config.yaml and overrides it with the values from 'set-cookie' header. Is there any way to disable this and have empty cookies before each request within a scenario?
I'm currently running 1.6.0-23.
I am assuming I am just misunderstanding something but I can't get auth cookies that the server is setting to be replayed by subsequent requests later in the scenario. When a user successfully logs into our api we return an
HttpOnly
cookie calledFuze
. So I have the following configuration:With debug output I"m getting the following:
From this it shows artillery submitting a request to
/login
and the server response containing aFuze
cookie. However the next request in the same scenario shows no cookies being sent which results in a 401 being returned (which is expected when not logged in).Reading the documentation shows
This makes me think that any cookie that the server sets should be automatically replayed by Artillery. Am I missing something?