Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

189
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda