Storing cookies in file and using them elsewhere

Hi,

I would need to save a specific cookie in a file on each user (csv) login in a website.

In another scenario, I need to load this cookie on the first page (it will autologin each gatling user).

What’s the code to do that.
For the first part, here is my code (not complete) :

feed(usersReadyFeed)
.exec(http(“Login”).post(""“https://mywebsite.com/checkout/j_spring_security_check”"")
.headers(headers_60)
.param(""“j_username”"", “”"${email}""")
.param(""“j_password”"", “”"${pwd}""")
.param("""_spring_security_remember_me""", “”“true”"")
.param(""“submit”"", “”“Je mâidentifie”"")
.check( headerRegex(“Set-Cookie”,"""(SPRING_SECURITY_REMEMBER_ME_COOKIE=.*)""").saveAs(“rememberMe”)))

Now, I think I just need to write the var “rememberMe” in a file, but I don’t know how.

For the second part, I think I just need to use the file as a simple feeder, right ?

Thank you very much for any help !!

Write an exec(function) to fetch the rememberMe attribute and write into a file there.