SameSite Cookies Explained for Beginners: A Simple Visual Guide



This site uses the original WordPress plugin OJapp PWA Marketing.

Each article can be added to your Home Screen with its own dedicated icon.

SameSite Cookies Explained for Beginners: A Simple Visual Guide

The SameSite attribute sounds technical, but the idea behind it is actually simple.
It controls when a browser is allowed to send your cookies.

Modern browsers like Chrome changed their default behavior, which is why cookies are no longer sent automatically across different websites.

This guide uses simple visual explanations to help beginners understand the difference between
SameSite=Lax, Strict, and None.


What Is the SameSite Attribute?

SameSite decides under what conditions a cookie will be sent.

Before SameSite became strict, cookies were sent everywhere — even when loading images or iframes from another domain.
That made cross-site tracking extremely easy.

SameSite fixes this by giving browsers clear rules.


Visual Guide: The 3 SameSite Modes

::contentReference[oaicite:0]{index=0}

SameSite has only three values:

  • Strict — most restrictive
  • Lax — the modern default
  • None — for third-party cookies (requires Secure)

① SameSite=Strict — “Only from your own site.”

Strict means the cookie is sent ONLY when navigating inside the same site.

For example, a cookie from example.com will:

  • ✔ Send when browsing inside example.com
  • ✘ NOT send when coming from another site’s link
  • ✘ NOT send inside iframes, images, or scripts

This is very secure, but too strict for most login-based websites — because clicking a link from another site would break the session.


② SameSite=Lax — “Mostly strict, but allow normal navigation.”

Lax is the default behavior in Chrome.

It works like Strict, except in one situation:
when the user clicks a normal link from another website.

  • ✔ Link click from another site → cookie is sent
  • ✘ iframe, img, script → cookie NOT sent

This keeps basic login flow working while reducing unnecessary tracking.


③ SameSite=None — “Allow third-party cookies.” (Requires Secure)

SameSite=None is used when you need a cookie to be sent in third-party contexts — like ads, analytics, embedded widgets, or external login systems.

However, there is a strict rule:

SameSite=None must also include Secure → cookies only sent over HTTPS.

If you forget this, you get errors like:

This Set-Cookie was blocked because it had the “SameSite=None” attribute but did not have “Secure”.


Quick Visual Summary

┌─────────────────────────────────────┐
│ SameSite=Strict                     │
│ → Only sent within the same site    │
│ → Most restrictive                  │
└─────────────────────────────────────┘

┌─────────────────────────────────────┐
│ SameSite=Lax (default)              │
│ → Sent only on top-level navigation │
│ → Link clicks allowed               │
└─────────────────────────────────────┘

┌─────────────────────────────────────┐
│ SameSite=None; Secure               │
│ → Third-party cookies allowed       │
│ → HTTPS required                    │
└─────────────────────────────────────┘

Why Was SameSite Introduced?

The reason is simple:

Old-style cookies allowed tracking everywhere.

  • Ad companies could follow users across multiple domains
  • Security risks like CSRF were easier to exploit
  • Browsers had no clear rules for third-party cookies

SameSite gives browsers strict guidelines that protect user privacy without breaking most websites.


When Developers Must Care About SameSite

You must handle SameSite manually in cases like:

  • External login (Google, Twitter, etc.)
  • Embedding iframes or widgets
  • Using multi-domain apps (auth.example.com → app.example.com)
  • Payment redirects (Stripe, PayPal)

Forgetting SameSite=None; Secure is a common cause of broken login sessions.


Conclusion: SameSite Is a Privacy Filter for Cookie Sending

  • Strict → only same-site
  • Lax → default, link clicks allowed
  • None → third-party allowed, Secure required

Once you understand these three rules, SameSite is no longer confusing — it’s simply a safety filter that prevents cookies from being sent in situations where they shouldn’t.

Add OJapp Tips as a preferred source on Google

Make it easier to find OJapp Tips articles in Google Search.


OJapp FREE · 1P1A

Turn Any Web Page into a Home Screen App

Skip complex PWA setup. Add one line of code and turn your
web page into an installable home screen app.


OJapp FREE - One Page. One App.


OJapp FREE · 1P1A

Webページをホーム画面アプリに

複雑なPWA設定やmanifest.jsonの作成は不要。
1行のコードを追加するだけで、Webページをホーム画面へ追加できるアプリに変えられます。


OJapp FREEでWebページをホーム画面アプリに

OJapp Tips  -  PWA・ホーム画面追加の実機検証ブログ

OJapp Tips - Practical PWA & Home Screen UX Lab

OJapp Tips is a technical blog documenting real-world PWA behavior, iPhone Safari quirks, home screen installation, manifest.json, Service Worker, Web App Manifest, WebClip, icon cache issues, and practical web development tips based on actual testing with iPhone, Android, and PC.

The articles are based on hands-on experiments from PWA LAB and real development experience with OJapp, Petal, and OJ-Pass. Instead of only repeating official documentation, OJapp Tips focuses on the details developers actually get stuck on.