Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

186
Views
set cookie on parent domain but from sub-domain website

When I visit a sub-domain website ex: https://sub2.example.com, from a browser console I can set a cookie for parent domain.

document.cookie = "nameCookie=HelloWorld; domain=.example.com;"

as per Cookie RFC this works! and this cookie should be available to all sub-domains. ex:

  • https://example.com
  • https://sub2.example.com
  • https://xxx.example.com

But my problem, this concept is not working on some websites.

for ex:

  • Go to https://square.github.io/

  • open browser console

    document.cookie = "nameCookie=HelloWorld; domain=.github.io;"
    console.log(document.cookie)
    

check that nameCookie is not available.

Why it is not working here? any Http header/rule setup on those websites?

about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Because github.io is on the list of effective top-level domains (eTLDs) (raw list here), so each github.io subdomain is treated like a subdomain of a top-level domain (that is, _______.github.io is treated just like _______.com or _______.co.uk).

about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!