Como adiciono o prefixo __Secure nesta linha .htaccess?

Como adiciono o prefixo __Secure nesta linha .htaccess?

Desculpe, não sou um especialista em Apache.

Preciso adicionar o __Secureprefixo a esta linha htaccess:

Header onsuccess edit Set-Cookie (.*) "$1; SameSite=Strict; Secure"

Isso é possível? Como?

Responder1

RESPOSTA ORIGINAL

Isso fornece as informações de que você precisa:

https://geekflare.com/httponly-secure-cookie-apache/

Procedimento de implementação no Apache

  • Certifique-se de ter mod_headers.sohabilitado no servidor Apache HTTP

  • Adicione a seguinte entrada em httpd.conf:

    Header always edit Set-Cookie ^(.*)$ $1;HttpOnly;Secure
    
  • Reinicie o servidor Apache HTTP para testar

ATUALIZAÇÃO 2022/12/21 às 20:58 GMT

Orientação sobreessesite indica o formato a serSet-Cookie: __Secure-ID=123; Secure; Domain=example.com; HttpOnly

Seguindo tambémSintaxe MDN, pelo seu exemplo, espero que você precise:

Header onsuccess edit Set-Cookie (.*) "__Secure-$1; SameSite=Strict; Secure"

Você também pode querer adicionar ; HttpOnlyum texto forte no final.

Header onsuccess edit Set-Cookie (.*) "__Secure-$1; SameSite=Strict; Secure; HttpOnly"

informação relacionada