Company logo
  • Empleos
  • Bootcamp
  • Acerca de nosotros
  • Para profesionales
    • Inicio
    • Empleos
    • Cursos y retos
    • Preguntas
    • Profesores
    • Bootcamp
  • Para empresas
    • Inicio
    • Nuestro proceso
    • Planes
    • Pruebas
    • Nómina
    • Blog
    • Calculadora

0

95
Vistas
How to get secure flag cookies in JavaScript console?

I wanted to get all the cookies from the current page including secure flag cookies. I know you can disable secure flag but I need to find a way to disable it with JavaScript or get them with JavaScript. They're not included in document.cookie.

7 months ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You already can access cookies with the secure flag the same way you can access cookies without this flag. The only difference is, that cookies with the secure flag can't be accessed if you request a page via HTTP instead of HTTPS.

If you don't see them using document.cookie then you likely either didn't request the page via HTTPS, or the HttpOnly flag is also set. In both cases, it isn't possible to access these cookies through JavaScript. (Making them accessible anyway would somewhat defeat the purpose of those flags.)

(If the HttpOnly flag is not set and you do request the page via HTTPS, then the problem must be elsewhere, such as the current domain or path not matching the one specified on the cookie.)

7 months ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar empleo Planes Nuestro proceso Comercial
Legal
Términos y condiciones Política de privacidad
© 2023 PeakU Inc. All Rights Reserved.