Set Cookie and Token inside Local Storage using K6

I can use HAR to record browser session. Then using converter, I can generate K6 script. With few modification, this script works.

Is it possible for me to set Cookie and Token inside Local Storage using K6 ?

HI @vishal.lanke,

Local storage is a web browser technology and isn’t support by k6.

Maybe if you explain what you are trying to do someone else or I can help you :slight_smile:

1 Like

Just to add to @mstoykov’s answer, at least parts of what you describe is possible using the built-in cookie jar. See https://k6.io/docs/using-k6/cookies#local-cookie-jars. However, this should likely not be necessary as you should be able to just store your cookie in a variable and reuse it in subsequent requests.

Hope that helps!