Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

306
Visualizações
Why can't I set session cookies? [Sovled]

I set session cookies but it creates new cookies. I'm tired of this Do you know how to fix it? Code:

document.cookie = ".ROBLOSECURITY=cookie; expires=session; path=/";
about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

Let's check documentation

;domain=domain (e.g., 'example.com' or 'subdomain.example.com'). If not specified, this defaults to the host portion of the current document location. Contrary to earlier specifications, leading dots in domain names are ignored, but browsers may decline to set the cookie containing such dots. If a domain is specified, subdomains are always included.

Note: The domain must match the domain of the JavaScript origin. Setting cookies to foreign domains will be silently ignored.

Your first cookie with domain www.roblox.com will be accessible only at www.roblox.com/... page but .roblox.com's cookie may be accessed by JS from all roblox.com subdomains.

Here is a good answer

So as @smac89 wrote in comment, You should add domain when create new cookie

document.cookie = ".ROBLOSECURITY=cookie; expires=session; path=/; domain=.roblox.com"
about 4 years ago · Juan Pablo Isaza Relatório

0

There is no syntax for what you want.

You can either not set the expiration value, the cookie will expire at the end of the session, or choose an arbitrarily large value.

Be aware that some browsers have problems with dates past 2038 (when the Unix epoch time exceeds a 32-bit integer).

See : https://stackoverflow.com/a/532660/1901857

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda