Skip to content

Instantly share code, notes, and snippets.

@abdessamadely
Created December 11, 2021 14:12
Show Gist options
  • Save abdessamadely/48ca35960cfd46a1db33f9a8ca8b8886 to your computer and use it in GitHub Desktop.
Save abdessamadely/48ca35960cfd46a1db33f9a8ca8b8886 to your computer and use it in GitHub Desktop.
const getCookieValue = (name) => (
pm.response.headers.get('Set-Cookie').match('(^|;)\\s*' + name + '\\s*=\\s*([^;]+)')?.pop() || ''
)
const jwtToken = getCookieValue('jwt-token')
pm.environment.set("jwtToken", jwtToken)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment