How do you embed Metabase on a different domain without breaking sign-in?
The first control is the session cookie's SameSite value. When your product runs on one domain and a self-hosted Metabase runs on another, the embed can load but the user keeps getting logged out, or the analytics never appear inside your app. Metabase signs users in with a session cookie, and browsers decide whether to send that cookie when the Metabase page is loaded inside a frame served from a different site. The SameSite attribute controls that decision. Metabase sets it through MB_SESSION_COOKIE_SAMESITE, which defaults to lax. For a cross-domain embed, the Metabase documentation describes setting the value to none in Admin > Embedding > Security, which is the setting the Metabase full app embedding guide points to for this case.
Teams need this change when the embedding page and the Metabase instance are on different sites. Two hostnames that share a parent domain, such as app.example.com and analytics.example.com, are usually the same site for cookie purposes, so the default may already work. Confirm this in your own environment by loading the embed in a browser with third-party cookies blocked and checking whether the session persists. Changing the cookie to none is not a free choice. Browsers only accept a SameSite=None cookie when it is also marked Secure, so the Metabase instance must be served over HTTPS. Also confirm that the embedding page's origin is on the authorized list in the embedding settings, because the cookie change alone does not allow an arbitrary site to frame your instance.
Before you change the setting in production, decide who owns the change and how you will verify it. Record the current value, make the change in a test instance that mirrors your domains and TLS setup, and test sign-in from each browser your users rely on, including the case where the first load is blocked and the user must reauthenticate. Note that the cookie is shared by every page on the Metabase host, so the change affects every embed on that instance, not only the one you are building. Your security team should also review the trade-off, since a more permissive cookie widens the set of sites that can ask a logged-in browser to use the session. Pair the change with the rest of your embedding security decisions rather than treating it as a one-line fix.
How the app, the browser and Metabase exchange the session cookie
The flow starts in the customer's browser, which loads the host app from its own origin and then opens Metabase in an iframe on a different origin. When that iframe request is cross-site, the browser checks the session cookie's SameSite setting before it decides whether to send the cookie to Metabase. Requests from the SDK then pass a CORS check against the origins Metabase accepts. Confirm this exact sequence against the Metabase version you deploy, because cookie and CORS handling can change between releases.
Cross-site iframe requests where the browser decides whether the session cookie is sent.
Which cookie and hosting choice fits your embed
This table compares the three ways to make embedded Metabase work across domains: keeping the default lax cookie, setting the cookie to none, or serving Metabase under the same site as the app. Read each row to see where the option applies, what the browser does with the session cookie, and what your team must still configure. The main takeaway is that the default is lax, and moving to none is a deliberate security trade-off rather than a required step for every embed.
| Option | Where it applies | What the browser does | What your team must still configure |
|---|---|---|---|
| Default lax (MB_SESSION_COOKIE_SAMESITE unset) | Metabase and the host app share a site, or the embed is not cross-site in the browser | Sends the session cookie on same-site requests and top-level navigations, but not on cross-site iframe requests | Confirm the embed really is same-site, and test that sign-in and dashboard loads work in the target browsers |
| None set in Admin > Embedding > Security | Metabase is iframed by an app on a different domain | Allows the session cookie in cross-site iframe requests, which the browser only accepts when the cookie is also Secure | Serve Metabase over HTTPS, add the app's origin to authorized origins, and review SSO and CORS settings |
| None set through MB_SESSION_COOKIE_SAMESITE | Containerized or scripted deployments that set configuration through environment variables | Same cookie behavior as the admin setting, applied at startup | Keep the value in your deployment config under change control, and check it after each upgrade |
| Same site hosting (for example, a subdomain of the app's domain) | Organizations that control DNS for both the app and Metabase | Treats the embed as same-site, so the default lax value usually works without relaxing the cookie | Plan DNS, TLS certificates and reverse proxy routing, and confirm the exact site boundary with your browser test matrix |
Setting SameSite none and allowing the app origin
This sequence moves a cross-domain Metabase embed from a blocked state to a working one by setting the session cookie for cross-site use, allowing the app's origin, and confirming sign-in holds in each target browser. Each step ends with a check so you know whether to move on.
Confirm HTTPS on both sites
Before changing any cookie setting, confirm that the app and the Metabase instance are both served over HTTPS with valid certificates, and that the Metabase site URL uses https. Browsers only send cookies marked SameSite none when they are also marked Secure, and that Secure attribute requires an HTTPS connection. Run the check from a private browser window against both hostnames and confirm there are no certificate warnings or mixed content errors. Done when both sites load over HTTPS without warnings, and the Metabase site URL in the admin settings matches the public HTTPS address.
Set the session cookie to none
As an administrator, open Admin > Embedding > Security and set the session cookie SameSite value to none. If you manage configuration through environment variables instead, set MB_SESSION_COOKIE_SAMESITE to none. The default is lax, which blocks the session cookie from being sent in cross-site embedded requests. Record who made the change and when, because it alters how every session on the instance behaves. Done when the setting shows none in the admin panel, or the variable is present in the deployment configuration.
Restart Metabase after an environment variable change
If you changed the setting through MB_SESSION_COOKIE_SAMESITE, restart the Metabase process or container so the new value is loaded. Changes made in the admin panel take effect without a restart, so skip this step in that case. Confirm the restart completed in your logs and that the instance responds before testing. Done when the process has restarted with the variable set and the login page loads on the HTTPS address.
Allow the app origin for embedding
In Admin > Embedding > Security, add the origin of the host application (scheme, hostname and port, for example ) to the list of authorized origins for embedding. Use the exact origin the browser will report, not a path, and avoid wildcards unless your security team has approved them. Repeat this for each environment, such as staging and production, with its own origin. Done when the origin appears in the list and the host application's origin matches the entry character for character.
Configure CORS for the SDK
If the app uses the modular embedding SDK or calls Metabase APIs directly from the browser, add the same app origin to the CORS settings that your Metabase deployment and any reverse proxy in front of it allow. Keep the allowed list limited to the origins you control. Check that the proxy passes the headers the SDK needs and does not strip them. Done when a preflight request from the app origin to the Metabase API returns the expected Access-Control-Allow-Origin header, which you can confirm in the browser network tab.
Verify the cookie attributes
Sign in to Metabase in a fresh private browser session, then open developer tools and inspect the session cookie under the application or storage panel. Confirm that SameSite shows None and that the Secure flag is set. Also check that the cookie domain and path match what your deployment expects. If SameSite is missing or still Lax, return to the earlier steps before continuing. Done when the cookie attributes match the expected values in the browser you tested.
Test the embed in each target browser
Open the host application in a fresh private window in each browser your users rely on, and load a page that contains the embed. Confirm that the embed renders without a second login prompt, that filters and questions respond, and that signing out of Metabase removes access. Repeat the test in every browser on your support list, since cookie handling differs between them. Done when the embed loads and keeps the session across navigation in all target browsers, and any browser that blocks third-party cookies has been documented with its workaround or limitation.
Admin setting or environment variable: which to use
Teams that manage settings through the interface set the session cookie SameSite value in Admin > Embedding > Security. Metabase documents this route for embedding on another domain, so an administrator can make the change without touching the container, the JAR or the orchestration files. The value is stored in the application database, which means it persists across restarts as long as that database is kept and restored.
- What changes: the cookie policy is stored as an instance setting and takes effect for the running instance without a redeploy.
- Audit trail: changes depend on Metabase's own activity records and your change process, so confirm what the audit log captures for admin setting edits on your plan.
- Redeployments: the setting survives image rebuilds and version upgrades when the application database is backed up and restored, but a rebuilt environment with a fresh database will start from the default.
- Who can change it: access is limited to Metabase administrators, so you need a documented owner and a rule for who may edit the Security page.
- Drift risk: nothing in your repository records the value, so a second environment can quietly differ from production.
Before relying on this route, confirm the current Metabase version's Security page and check the change is reflected in every environment you operate.
Teams that manage configuration as code set MB_SESSION_COOKIE_SAMESITE in the container definition, Helm values, systemd unit or deployment manifest. The variable sets the SameSite directive on the session cookie and defaults to lax, so the value must be set explicitly to none for cross-domain embedding. The setting then lives in the same place as the rest of your runtime configuration.
- What changes: the environment variable is read at process start, so a change requires a restart or rollout of the Metabase instance.
- Audit trail: changes are recorded in version control and pull request history, which gives you a diff, a reviewer and a timestamp.
- Redeployments: the value survives rebuilds and new environments as long as the manifest is applied, and it can be tested in staging before production.
- Who can change it: access follows repository and pipeline permissions, which is easier to review than UI rights in many organizations.
- Consistency: the same manifest can be reused across environments, reducing drift between them.
Check how your secrets and configuration pipeline injects the variable, and confirm the value your running process actually reports after each rollout.
Some environments end up with both the Admin setting and the environment variable. Teams often add the variable during a deployment change and later set the UI value, or an older runbook sets one and a new pipeline sets the other. The effective behaviour then depends on which one Metabase applies, and that should be confirmed rather than assumed.
- Confirm precedence: test in a non-production instance by setting the two values to different results and checking the session cookie the browser receives.
- Check the running value: after a deployment, inspect the response headers for the session cookie and record the result.
- Remove duplicates: pick one authoritative control for each environment and delete the other, or document why both exist.
- Record the decision: note the chosen control in your configuration repository and in the change record.
- Re-test after upgrades: confirm the behaviour again after each Metabase upgrade, since precedence and defaults can change between releases.
Ask your Metabase contact or check the current documentation to confirm which setting wins in your version before you finalize the configuration.
What a none cookie setting changes in your security posture
Setting the session cookie's SameSite value to none is a widening of the browser's rules, and the security owner should treat it that way. With the default lax value, the browser withholds the Metabase session cookie from most cross-site requests, which limits how other sites can trigger authenticated actions in a signed-in user's browser. Once the value is none, the browser sends the session cookie in cross-site contexts, including requests started by pages on other domains. Any page that a signed-in user visits while logged in to Metabase can then cause requests that run with that user's permissions. Your threat model should record this as a new exposure, not as a configuration detail.
Several controls narrow the exposure, and each should be verified rather than assumed. Restrict embedding to known origins so that only your application can frame Metabase. Serve both the application and Metabase over HTTPS only, because browsers reject none cookies that are not marked Secure. Keep session lifetimes short so that a stolen or lingering session has a limited window. Embed only the dashboards and questions the embedding product needs, so that a cross-site request reaches a small set of read paths rather than the whole instance. Confirm the exact session timeout and cookie attributes in your own environment, since these depend on your Metabase version and reverse proxy configuration.
The trade-off is a business decision that belongs to a named security owner, who should accept it in writing before the setting goes live. The record should name the affected embeds, the controls relied on, the session lifetime, and who approved the risk. Review it whenever the embedding application changes domain or framework, whenever Metabase is upgraded, and whenever a new dashboard is embedded. The written acceptance expires in practice as soon as the surrounding system changes, so a periodic review and a change-triggered review both belong in the operating procedure.
Controls to put around a cross-domain embed
A cross-domain embed moves trust decisions into the browser, the app and the Metabase instance at once. The controls below work as layers, and each one covers a different failure, so none should be treated as sufficient on its own.
Allowlist of embedding origins
Limit which sites may frame Metabase and which origins may call it through the SDK. The application team owns the list and reviews it whenever a new customer domain or app environment is added. Check that staging and preview hostnames are not left in production settings, and that wildcard entries are avoided unless the team can justify each one.
Full app embedding docsTLS on both sites
Serve the app and the Metabase instance over HTTPS only, with valid certificates and HSTS where the team can support it. Because SameSite=None cookies are only sent over secure connections, a plain HTTP hop breaks the embed and exposes the session. The infrastructure team owns certificate issuance and renewal, and should confirm that redirects from HTTP do not leave a session cookie in transit.
Cookie attribute checks in CI
Test the Set-Cookie header from the Metabase session cookie in a pipeline or scheduled monitor. Confirm the SameSite value, the Secure and HttpOnly attributes, and the domain scope after every deployment or configuration change. The platform team owns the check. Run it against the same configuration the embed uses, since a setting changed only in a test environment proves nothing about production.
Audit trail review for embedded sessions
Review Metabase activity and audit data for logins, embedded sessions and changes to embedding settings. Look for unexpected sessions from unknown origins, spikes in access to sensitive collections, and admin changes to security settings. The security team owns the review schedule. Usage analytics and auditing are included only on Pro and Enterprise plans, so confirm the plan before relying on it.
Metabase pricingCross-site request and clickjacking tests
Test whether the app and Metabase resist cross-site request forgery and whether a hostile page can frame sensitive views. Include requests sent from a page on an unlisted origin, and check the frame-ancestors and related headers on each side. The security testing team owns the test cases and retests after each change. Passing these tests does not prove the session model is safe, because SameSite=None deliberately relaxes one browser defense.
Documented SameSite change process
Record every change to the session cookie setting, including who approved it, the reason, the environments affected and the rollback step. The change owner is usually the platform lead, with security sign-off. Changing MB_SESSION_COOKIE_SAMESITE or the Admin setting affects every embed on the instance, so a tested rollback path matters as much as the change itself.
What to confirm before you change the cookie setting
Before you set the session cookie to none, confirm the exact cross-origin settings your Metabase version requires for the embedding SDK and the app's allowed origins. The requirements differ between releases, so check the embedding documentation for the version you run rather than copying a configuration from an older guide or a forum post. Confirm the session cookie SameSite value in Admin > Embedding > Security, and confirm the value your instance actually serves by inspecting the Set-Cookie header in a browser after login, since the environment variable MB_SESSION_COOKIE_SAMESITE defaults to lax and may be set differently in your deployment.
Confirm whether SSO-based embedding is part of your design. SSO-based embedding requires the Pro or Enterprise plan, so if you use the open source or Starter edition, your embed design may rely on guest authentication instead, and the cookie change may not matter for the flow you planned. Also list the browsers and versions your users run, because cookie handling for cross-site contexts varies across browsers and changes over time. Test the embed in each browser on your support matrix, including private browsing modes, and do not treat a single successful test as proof for the rest.
Check whether your reverse proxy, load balancer or CDN rewrites or strips cookie attributes such as SameSite and Secure, and whether your TLS termination preserves the headers Metabase depends on. Finally, map how your identity setup interacts with the session: which identity provider issues the login, how long sessions last, and whether your application's own cookies also need cross-site settings. Treat every item here as something to verify in your environment and against the documentation for your version, not as a guarantee that the embed will work once the setting is changed.
Questions teams ask before changing the embed domain setup
Does moving embeds to another domain require a Metabase license upgrade?
Changing the SameSite cookie setting does not by itself require a paid plan, but the identity model you use for embeds often does. Guest embeds work on every plan, including Open Source. SSO-based embedding, which needs a signed-in user session, requires Pro or Enterprise. Metabase's pricing page lists Pro at $575 per month, or $517.50 per month billed yearly, with the first 10 users included, and lists Enterprise as priced by quote starting at $20,000 per year. Confirm the current figures on the Metabase pricing page before you budget, and check which plan your user count and embedding pattern need.
How long does a cross-domain embedding change take?
Duration depends less on the cookie setting, which is a single admin change, than on the surrounding work. Drivers include how many embedding pages and apps are affected, whether SSO is already working, how many domains and subdomains sit in the path, whether TLS certificates are in place for every host, and how many browsers and devices your test matrix covers. A team with a working SSO setup and one application can finish the configuration and testing quickly. A team that also has to rebuild identity configuration or certificates should plan for more time. A written scope from a partner should state the timeline and its assumptions.
What does our team need to provide before the work starts?
Gather the inputs before the change window so testing is not blocked. You need the exact application domain and the Metabase domain, including subdomains, a valid TLS certificate for each host served over HTTPS, the identity provider configuration and the signing details for any JWT or SAML flow, a list of the embedding pages and their authorized origins, and test accounts for each user type. Also list the browsers and versions your customers use, along with any corporate browser policies that block third-party cookies. Confirm these items with your identity and network teams early, since they often hold the deciding details.
Can one internal engineer make this change alone?
A single engineer with admin access to the Metabase instance and reverse proxy can usually make the setting change, but the change touches several teams. Identity, network, certificate management and front-end work each have a role, and browser cookie behavior is easy to misread without a second pair of eyes. A solo engineer should plan for review of the security trade-offs, a documented rollback, and a test pass in each target browser. If your team has not run a cross-site cookie test before, a short review or a managed change with a partner can reduce the chance of an outage during rollout.
Do guest embeds avoid the cookie question entirely?
Guest embeds reduce the cookie question but do not always remove it. A guest embed authenticates the viewer with a signed JWT created by your server rather than a Metabase login session, so it does not depend on the user's session cookie in the same way. You still need to confirm how the embed is rendered, whether any part of the flow depends on cookies or iframe permissions, and how browsers treat third-party storage in your customers' environments. Guest embeds also carry their own limits on locked parameters and token handling, which should be reviewed separately before you rely on them.
What should we test after changing the SameSite setting?
Test the full embed journey in every target browser, not only the login page. Check that the dashboard loads inside the iframe, that filters and drill-throughs work, that sign-in and sign-out behave as expected, and that session expiry does not break the embed. Verify that MB_SESSION_COOKIE_SAMESITE is set as intended and that cookies carry the attributes you chose. Confirm that only the origins you intended can frame Metabase, and that a user without access to a dashboard still cannot see its data. Keep the rollback path tested as well, so the setting can be reverted quickly if a browser behaves differently than expected.
How DeployOpen scopes and delivers cross-domain Metabase embedding
DeployOpen plans, implements, hardens and documents self-hosted Metabase inside your own infrastructure, including the cookie, origin and browser settings that cross-domain embedding depends on. Each engagement starts with a written scope that names the domains, embed types and identity setup involved before any configuration changes are made.
How we scope
- Map which app domain hosts the embed and which domain serves your Metabase instance.
- Confirm the embed types in use, such as full app embedding or the React SDK, and the authentication path each needs.
- Agree in writing which browsers, plans and SameSite trade-offs the security team has approved before work starts.
How we build
- Configure the session cookie SameSite setting and origin allow-lists in a staging instance that mirrors production domains.
- Test embedded sessions in each target browser, including login, refresh, logout and sessions that cross the domain boundary.
- Review the security trade-off of each setting with your team and record the decision alongside the configuration.
How we hand over
- Deliver a configuration record listing every cookie, origin and embedding setting with its owner and reason.
- Provide a test script that your team can rerun after Metabase upgrades or domain changes.
- Walk through the runbook covering failure symptoms in browsers and the rollback steps for each setting.
How we support
- Offer ongoing support, upgrades and continuous testing as a retainer after the initial handover.
- Retest cookie and origin behaviour when Metabase versions change or when your app domains are updated.
- Confirm with your team the current plan requirements for each embedding method before you commit to a licence tier.

