Saltar al contenido
uencoder

Usar cookies securely

Cookies debe ser establecer con Seguro, HttpOnly, SameSite, y proper expiration. Aprender cookie attributes y seguridad best practices.

  1. 1

    Cookie security attributes: Secure (only sent over HTTPS), HttpOnly (not accessible via JavaScript — prevents XSS theft), SameSite (Lax/Strict/None — controls cross-site sending, prevents CSRF), Domain (scope), Path (scope), Max-Age/Expires (lifetime), Partitioned (CHIPS — per-top-level-site). For session cookies: Secure + HttpOnly + SameSite=Lax + short Max-Age.

  2. 2
    Codificador Base64 →

    Codificar cookie values as base64 if they contain binary data or special characters. This ensures the cookie value is a valid cookie string (no spaces, semicolons, or commas). The server decodes base64 to recover the original value. For JSON cookies, encode the JSON string as base64.

  3. 3
    Generador de HMAC →

    Sign cookies with HMAC to prevent tampering. The cookie value is: data + "." + HMAC(secret, data). On receipt, verify the HMAC before trusting the data. This allows stateless session cookies — the session data is in the cookie (signed, not encrypted), and the server verifies the signature without a database lookup.

Preguntas frecuentes

When to use HttpOnly?
Always, for cookies that the browser needs but JavaScript does not (session IDs, CSRF tokens). HttpOnly prevents XSS from stealing the cookie via document.cookie. The only exception is cookies that JavaScript must read (e.g., a theme preference) — but these should not be security-sensitive.
SameSite=Lax vs Strict vs None?
Lax (default): cookies sent on top-level navigations (link clicks, form GET) but not on cross-site POST or iframes — prevents CSRF for most cases. Strict: cookies only sent for same-site requests — strongest but breaks cross-site links (user follows a link to your site, no cookies sent, appears logged out). None: always sent (requires Secure) — needed for third-party cookies (iframes, embeds).

Flujos que resuelven esta tarea

Convertir Ascii85 a Base64
Decodificar Ascii85 y recodificar como Base64 para mayor compatibilidad.
CANALIZACIÓN
Convertir Base2048 a Base64
Decodificar Base2048 (emoji) y recodificar como Base64 para transporte estándar.
CANALIZACIÓN
Convertir Base32 a Base64
Decodificar una cadena codificada en Base32 a bytes y recodificar como Base64 para una representación más compacta.
CANALIZACIÓN
Convertir Base58 a Base64
Decodificar Base58 y recodificar como Base64 para compatibilidad estándar.
CANALIZACIÓN
Codificar en Base64 y decodificar para verificar ida y vuelta
Codificar texto a Base64 y decodificarlo para verificar que el recorrido de ida y vuelta preserva los datos originales.
CANALIZACIÓN
Blowfish cifrar y luego Base64
Cifrar con Blowfish y luego codificar en Base64 para transporte seguro en texto.
CANALIZACIÓN
DES cifrar y luego Base64
Cifrar con DES y luego codificar en Base64 para compatibilidad heredada.
CANALIZACIÓN
Codificar un payload JSON para transporte por URL
Preparar un documento JSON para un parámetro URL: embellecer, codificar en Base64, luego codificar por ciento — el inverso exacto de la cadena de decodificación de parámetros anidados.
CANALIZACIÓN
AES cifrar y luego codificar en Base64
Cifrar texto plano con AES y codificar el texto cifrado como Base64 para transporte seguro en texto.
CANALIZACIÓN
Hash contenido y codificar como Base64
Calcular un hash de la entrada y codificar el resumen como Base64 para transporte compacto.
CANALIZACIÓN
Convertir Hex a Base64
Decodificar una cadena Hex a bytes y recodificarla como Base64 para transporte compacto.
CANALIZACIÓN
Firmar HMAC y luego codificar en Base64
Generar firma HMAC y luego codificar en Base64 para encabezados de autenticación de API.
CANALIZACIÓN
Firmar HMAC y verificar
Generar una firma HMAC para un mensaje y verificarla contra una firma esperada.
CANALIZACIÓN
Firmar HMAC una cadena de solicitud API
Generar una firma HMAC-SHA256 para un payload de solicitud para autenticar llamadas API.
CANALIZACIÓN
Codificar Morse y transporte Base64
Codificar texto como código Morse y luego codificar en Base64 para transporte digital.
CANALIZACIÓN
RC4 cifrar y luego Base64
Cifrar con RC4 y luego codificar en Base64 para transporte.
CANALIZACIÓN
Hash RIPEMD-160 y luego Base64
Calcular hash RIPEMD-160 y luego codificar en Base64 para transporte.
CANALIZACIÓN
Barajar texto y codificar Base64
Barajar caracteres de texto y luego codificar en Base64 el resultado.
CANALIZACIÓN
Escape Unicode y codificar Base64
Escapar texto Unicode y luego codificar en Base64 para transporte seguro en ASCII.
CANALIZACIÓN
Codificar URL y luego doble Base64
Codificar URL y luego codificar en Base64 para doble codificacion en payloads API.
CANALIZACIÓN
UUencode y luego Base64
Codificar texto con UUencode y luego codificar en Base64 el resultado para doble codificacion.
CANALIZACIÓN
Generar UUID y codificar Base64
Generar un UUID y codificarlo en Base64 para almacenamiento compacto.
CANALIZACIÓN

Herramientas relacionadas