NuGet Package Serialize User Info in a Protected Cookie

An HttpModule that will serialize user information to a chunked protected cookie (with MachineKey) and deserialize on every request to a ClaimsPrincipal.

Usage:

var user = new List>
{
new KeyValuePair("name", "John Foo"),
new KeyValuePair("id", "1234"),
new KeyValuePair("email", "foo@gmail.com")
};

ClaimsCookieModule.Instance.CreateSessionSecurityToken(user);

That's it.

Now, you will be able to access the user claims like this:

((IClaimsIdentity)User.Identity).Claims

The cookie will be chunked in multiple cookies to avoid hitting a limit if you are storing lots of user info and it will be deflated and protected with the machine key.

Info

Version: 1.1.0
Author(s): Auth0
Last Update: Tuesday, July 23, 2013
.NET Fiddle: Create the first Fiddle
Project Url: https://github.com/auth0/ClaimsCookie
NuGet Url: https://www.nuget.org/packages/ClaimsCookie


Install
Install-Package ClaimsCookie
dotnet add package ClaimsCookie
paket add ClaimsCookie
ClaimsCookie Download (Unzip the "nupkg" after downloading)

.NETFramework 4.0 .NETFramework 4.5 1 package depend on this package.


Tags



STATS

must-have-score

1.9

avg-downloads-per-day

4

days-since-last-release

2219