Skip session commit on telemetry event forwarding

What does this MR do and why?

The event forwarding endpoint (/-/collect_events) authenticates through the Rails session, so each browser telemetry beacon commits the session and refreshes its TTL. Snowplow activity tracking pings this endpoint on a heartbeat while a page is active, which keeps the session alive and defeats inactivity-based session expiry.

This sets request.session_options[:skip] on the endpoint, so it still authenticates and forwards events but no longer commits or extends the session, matching the pattern already used by SearchController.

This is pre-existing behavior (any authenticated request refreshes the session); it was surfaced while verifying the session-expiry modal work. It affects instances that send telemetry same-origin to /-/collect_events (self-managed and Dedicated with product usage data enabled). GitLab.com is unaffected, since it sends telemetry to an external collector cross-origin, so no session cookie is sent.

References

Found while verifying !247910 (closed) ("Warn on SAML instances when a session expires").

Screenshots or screen recordings

Backend-only change, no UI.

How to set up and validate locally

  1. On a local GDK, product usage data is on by default, so pages POST to /-/collect_events. Confirm in DevTools Network.
  2. Set a short Session duration (Admin > Settings > General > Account and limit), for example 2 minutes, and restart GitLab.
  3. Sign in, open a page, and keep interacting (mouse moves, scrolls) so Snowplow page pings keep firing.
  4. Watch the /-/collect_events responses in DevTools: X-Gitlab-Session-Expires-At should stay flat across pings. Before this change it stepped forward on each ping.
  5. Confirm the session still expires at the configured duration despite the ongoing pings (the next navigation redirects to sign-in).

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist.

Merge request reports

Loading
Loading