[GH-ISSUE #1138] [Snippet Request] Update single Cookie to request #1133

Open
opened 2026-03-03 19:48:39 +03:00 by kerem · 1 comment
Owner

Originally created by @DanielReyesDev on GitHub (Feb 7, 2022).
Original GitHub issue: https://github.com/ProxymanApp/Proxyman/issues/1138

Originally assigned to: @NghiaTranUIT on GitHub.

Proxyman version? (Ex. Proxyman 1.4.3)

3.0.0

macOS Version? (Ex. mac 10.14)

11.6.3

Snippet Request

Given an ongoing or incoming request with multiple cookies, I'd like to override a single cookie. This would be very useful 🙏

Originally created by @DanielReyesDev on GitHub (Feb 7, 2022). Original GitHub issue: https://github.com/ProxymanApp/Proxyman/issues/1138 Originally assigned to: @NghiaTranUIT on GitHub. ### Proxyman version? (Ex. Proxyman 1.4.3) 3.0.0 ### macOS Version? (Ex. mac 10.14) 11.6.3 ### Snippet Request Given an ongoing or incoming request with multiple cookies, I'd like to override a single cookie. This would be very useful 🙏
Author
Owner

@NghiaTranUIT commented on GitHub (Feb 7, 2022):

Because Cookie is just a Header, you can simply override as the same way you do with the Header.

function onRequest(context, url, request) {
    var cookies = request.headers["Cookies"];
    cookies.replace("AAA", "New Value")
    request.headers["Cookies"] = cookies;
    return request;
}

Ref: https://docs.proxyman.io/scripting/snippet-code#http-header

<!-- gh-comment-id:1031490837 --> @NghiaTranUIT commented on GitHub (Feb 7, 2022): Because Cookie is just a Header, you can simply override as the same way you do with the Header. ```js function onRequest(context, url, request) { var cookies = request.headers["Cookies"]; cookies.replace("AAA", "New Value") request.headers["Cookies"] = cookies; return request; } ``` Ref: https://docs.proxyman.io/scripting/snippet-code#http-header
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/Proxyman#1133
No description provided.