Skip to content

Setting marketing cookie: for logged in users

Miracle Banks requested to merge marketing-cookie into master

What does this MR do and why?

Describe in detail what your merge request does and why.

We would like to create a first party cookie in the product that will enable the marketing site to recognize a logged in Gitlab user.

When a user starts a session through sign in or remember_me token about_gitlab_active_user cookie is set

Engineering Notes

The user's session ID can be stored in a cookie on the client-side, and sent with each request to the server. The server can then look up the user's session in the database(or API) to determine if they are logged in or not.

This solution was also suggested by a Staff Support Engineer in the #g_manage_auth slack channel

related to: gitlab-com/marketing/digital-experience/buyer-experience#1919 (closed)

closes gitlab-com/marketing/digital-experience/buyer-experience#1919 (closed)

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

When logged in image
When logged out image

How to set up and validate locally

Ensure that Saas is simulated prior to testing

  1. Spin up GDK locally
  2. Open Devtools > Application > Cookies
  3. about_gitlab_active_user cookie's value will change to true when user logins in and will persist when browser is closed and reopened
  4. about_gitlab_active_user cookie will be deleted when user logs out

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Miracle Banks

Merge request reports