Skip to content

chuongxl/Rhasta.Owin.Security.Cookies.Store.Redis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Rhasta.Owin.Security.Cookies.Store.Redis

Cookie-Store Redis is a library that includes the implementation for storing cookies in redis.

Installation :

PM> Install-Package Rhasta.Owin.Security.Cookies.Store.Redis

Configuration :

  <configSections>
  <section name="redisCacheClient" type="StackExchange.Redis.Extensions.Core.Configuration.RedisCachingSectionHandler, StackExchange.Redis.Extensions.Core" />
</configSections>

<redisCacheClient allowAdmin="true" ssl="false" connectTimeout="5000" database="0">
  <hosts>
    <add host="127.0.0.1" cachePort="6379" />
  </hosts>
</redisCacheClient>

<appSettings>
  <add key="Cache:KeyPrefix" value="AppName" />
</appSettings>

Example :

public void Configuration(IAppBuilder app)
      {

          IDataProtector dataProtector = app.CreateDataProtector(typeof(RedisAuthenticationTicket).FullName);
          app.UseCookieAuthentication(new CookieAuthenticationOptions
          {
              AuthenticationType = CookieAuthenticationDefaults.AuthenticationType,
              SessionStore = new RedisSessionStore(new TicketDataFormat(dataProtector)),
              LoginPath = new PathString("/Auth/LogOn"),
              LogoutPath = new PathString("/Auth/LogOut"),

          });


      }

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published