Skip to content
UniKit

Cookie import helper

Parse a cookie string or Set-Cookie header into name/value pairs and emit runnable document.cookie statements, a JSON list or a Cookie request header, flagging attributes such as HttpOnly and SameSite=None that JavaScript cannot set.

Runs in your browserEvery computation happens in your browser — your data never leaves this device.

Accepts flat pairs such as `a=1; b=2` and server Set-Cookie lines, where Path / Domain / Max-Age / Expires / SameSite / Secure / HttpOnly are parsed as attributes. One record per line.

Import code

Copy it and run it in the target site’s console; cookies are only written for the current site.

Paste a cookie to generate import code

What this tool does

  • Turn a cookie string copied from a capture, log or ticket into document.cookie statements you can run in the console
  • Parse a server Set-Cookie line to see Path / Domain / Max-Age / SameSite / HttpOnly and which attributes JavaScript cannot set

Example

Input

session=abc123; theme=dark

Output

// unikit cookiedaorus · 在目标站点的控制台执行 / run in the target site console
document.cookie = "session=abc123; path=/";
document.cookie = "theme=dark; path=/";

document.cookie statements are produced by default with path=/, and attributes JavaScript cannot set (HttpOnly, SameSite=None without Secure) are listed as warnings.

Frequently asked questions

Why does an HttpOnly cookie not take effect?

document.cookie can only write cookies that are not HttpOnly: the attribute is ignored on assignment and only a server Set-Cookie can send it. To carry a full session, copy the Cookie header from your own logged-in browser, and never hand that value to a third party.

Why is SameSite=None rejected?

Browsers require SameSite=None to come with Secure on an HTTPS page, otherwise the cookie is dropped. The tool warns when Secure is missing, and you can either enable the Secure option or switch to Lax / Strict.

What are the Domain and Path limits?

JavaScript can only write cookies for the current site and its subdomains: Domain must be the current domain or its parent, otherwise the browser rejects it. Path controls where the cookie is visible and defaults to / for the whole site.

Why are some values percent-encoded?

Cookie values cannot contain spaces, quotes, commas, semicolons or non-ASCII characters, so such values are written with encodeURIComponent and reported as an "encoded value" warning; read them back through decodeURIComponent when needed. Parsing and generation both run locally and cookies are never uploaded.

Keywords:document.cookieSet-CookieHttpOnlycookie importcookiedaorus

Related tools