Skip to content

Instantly share code, notes, and snippets.

View jafetsanchez's full-sized avatar

Jafet Sánchez jafetsanchez

View GitHub Profile
@jafetsanchez
jafetsanchez / RijndaelCrypt.cs
Created July 13, 2011 11:31
Rijndael on C# and Java
#region Using
using System;
using System.Security.Cryptography;
using System.Text;
#endregion
namespace YourApp.Security.Cryptography
{
public void createJwtCookie(String jwtToken, HttpServletResponse response)
{
Cookie cookie = new Cookie("MIGALLETITA", jwtToken);
//MUST have option
cookie.setHttpOnly(true);
/*Expiration is in 1 week*/
cookie.setMaxAge(7 * 24 * 60 * 60);
cookie.setPath("/");