# Leaked GitLab Session Cookie? Revoke the Session

> GitLab session cookie exposed or leaked? Revoke the active session, change your password and audit your account activity. Step-by-step guide.

Source: https://leakwatch.net/secrets/gitlab-session-cookie

---

[LeakWatch](/)

[Product](/product)[Live feed](/leaks)[Guides](/secrets)[Blog](/blog)[Free scan](/)

1.  [Home](/)
2.  [Secrets](/secrets)
3.  GitLab Session Cookie

Code & CI · Secret guide

# Leaked GitLab Session Cookie: what to do in the first hour

Critical severityDetected onlyLast verified October 30, 2026 · 5 min read

A GitLab session cookie is not an API key. It is the proof, kept in your browser, that you are already signed in. Whoever holds the value can often act as you in the GitLab web interface without a password and, depending on the instance, without being asked for a second factor again. With your account that means private repositories, merge requests, CI/CD variables, project settings, tokens you can create and members you can invite. The danger is account takeover, which then opens source code and pipeline secrets. Revoke the session first, then investigate what the account did.

[Check your GitHub account for leaked secrets — free](/)

Provider

GitLab

Severity

Critical

Impact

Source code and build access

Checked live by LeakWatch

No

## What a GitLab Session Cookie looks like

The cookie is named `_gitlab_session` and its value is a string of lowercase letters and digits. LeakWatch looks for the name, an equals sign and exactly 32 characters:

```text
_gitlab_session=xxxx…   (name, "=", then 32 lowercase letters or digits, shortened here)
```

You meet it in a few places: a `Cookie:` header copied from the browser developer tools, a saved HAR file, a `curl` command exported with “copy as cURL”, a cookie jar file such as `cookies.txt`, or a log line that prints request headers. It is a session value that expires or ends when the session is revoked, unlike a personal access token (`glpat-` prefix), which you create on purpose and which stays valid until it expires or is revoked. A trailing part of a longer cookie value, or a different cookie such as a remember-me cookie, is a different thing: treat any GitLab cookie that reached a public place as exposed.

## How GitLab Session Cookies get leaked

-   **Bug reports with a HAR file.** A browser network capture attached to an issue or a support request contains every cookie of the session.
-   **Copied cURL commands.** A command pasted into a README, a chat or a ticket to show an API problem, with the `Cookie:` header still inside.
-   **Scrapers and test scripts.** A script that reuses a logged-in browser session to call GitLab pages, committed with its cookie constant.
-   **Cookie jar files.** A `cookies.txt` exported for a download tool or an automated test and committed with the project.
-   **Debug logging.** A proxy, reverse proxy or application that logs full request headers into a public log or paste.

## What to do in the first hour

1.  **Revoke the session.** Sign in to GitLab and open your profile settings, then the list of active sessions, and revoke every session you do not recognize, or all of them (see the link below). Revoking the session invalidates the cookie.
2.  **Change your password** from a clean device and sign out everywhere. If you use two-factor authentication, check that it is still yours, and generate new recovery codes if you are unsure.
3.  **List your tokens.** Review personal access tokens, SSH keys, deploy keys and OAuth applications on your account. Delete any you did not create, because an attacker with a session can add one to keep access after the cookie is gone.
4.  **Read the audit trail.** Check your account activity and, if you administer a group or an instance, the audit events: new tokens, membership changes, project visibility changes, exported projects and changed CI/CD variables.
5.  **Rotate secrets exposed to the account.** Any CI/CD variable or deploy credential the account could read may have been copied. Rotate the sensitive ones.
6.  **Check pipelines.** Look for pipeline or config changes you did not make, runners added to projects and new webhooks.
7.  **Clean up the code** and the history that contained the cookie. See [I accidentally pushed an API key to GitHub](/blog/i-accidentally-pushed-an-api-key-to-github).

Not sure what else leaked from the same repository? [Run a free scan](/).

[Not sure what else leaked? Run a free scan.](/)

## Revoke it at GitLab

A session is revoked from the active sessions page of your GitLab account settings, after you sign in. The page lists the sessions of your account with their device and last activity, and each can be revoked. For a self-managed instance, use the same page on your own instance, or ask an administrator, who can also impersonate-check and revoke. A person has not confirmed the exact menu wording for this guide, and the interface can change, so if the page differs from this description, look for the section where active sessions are listed, and follow GitLab’s documentation.

## How LeakWatch detects it

The rule is called GitLab Session Cookie. It matches the literal text `_gitlab_session=` followed by exactly 32 lowercase letters or digits. A value that is shorter, or one that has uppercase letters at the start, does not match in the way a full value does, and the cookie name must be present: a bare 32-character string is never reported. The prefilter keyword is `_gitlab_session=`. The severity is **critical**, because a live session is account access. This type is not checked live: LeakWatch does not send any request to GitLab with the cookie it found, so a reported cookie may already have expired.

LeakWatch detects this format but does **not** check it live: it can tell you the key is exposed, not whether it still works. Assume it does until you have revoked it.

## FAQ

Is a session cookie as dangerous as a password?

In practice, yes, until the session ends. It lets someone act as you in the web interface without knowing the password, which is why you revoke the session before anything else.

Does changing my password end the session?

It may not on every setup, so do not rely on it. Revoke the sessions explicitly from the active sessions list, then change the password.

Can the cookie be used against the API?

The cookie is meant for the web interface, and API use is normally done with tokens. Treat both as possible: an attacker could create a token from the web session, which is why you review your tokens.

## Related

-   [GitLab Personal Access Token](/secrets/gitlab-personal-access-token)
-   [GitLab Runner Registration Token](/secrets/gitlab-runner-registration-token)
-   [GitHub Personal Access Token](/secrets/github-personal-access-token)
-   [I accidentally pushed an API key to GitHub](/blog/i-accidentally-pushed-an-api-key-to-github)
-   [Which vendors leak most this week](/leaks/trends)
-   [All secret guides](/secrets)

[Get alerted next time a secret leaks — create a free account](/)

LeakWatch is not affiliated with GitLab.

![Gabriel Diyan, founder of LeakWatch](/brand/Photo-Gabriel-Diyan.webp)

Gabriel Diyan (0xCr0c0)

Cybersecurity student, founder of LeakWatch. I built and run the scanner described here — the detection patterns, the false-positive classifier and the provider validators are mine. [More about who I am](/about).

[GitHub](https://github.com/Leakwatch-Scan) · [X](https://x.com/LeakwatchScan) · [LinkedIn](https://www.linkedin.com/in/gabriel-diyan-80a378375) · [GitHub (personal)](https://github.com/crocogab)

LeakWatch

Secrets leak into public commits every minute. This watches the forges for yours. Built and run by [Gabriel Diyan](/about), a cybersecurity student — [why LeakWatch exists](/about).

Scan

-   [Product](/product)
-   [Live feed](/leaks)
-   [Trends](/leaks/trends)
-   [API docs](/docs)
-   [CI/CD](/docs?tab=ci)

Read

-   [Blog](/blog)
-   [Secret guides](/secrets)
-   [Changelog](/changelog)
-   [About](/about)

Verify

-   [Security](/security)
-   [Privacy](/privacy)
-   [Terms](/terms)
-   [Legal](/legal)
-   [Contact](/contact)
-   [Status](https://status.leakwatch.net)

© 2026 LeakWatch

[GitHub](https://github.com/Leakwatch-Scan)[X](https://x.com/LeakwatchScan)
