TheCloudlessSky / Harbour.RedisSessionStateStore

A Redis based SessionStateStoreProvider written in C# using ServiceStack.Redis.
MIT License
166 stars 76 forks source link

Non-Web.Config Configuration #10

Closed micahasmith closed 10 years ago

micahasmith commented 10 years ago

If i need to set my redis server URL somewhere other than the web.config, how is that done?

TheCloudlessSky commented 10 years ago

Hey @micahasmith,

Check out the bottom of the readme. The basic idea is this:

private IRedisClientsManager clientManager;

protected void Application_Start()
{
    // Or use your IoC container to wire this up.
    this.clientManager = new PooledRedisClientManager("localhost:6379");
    RedisSessionStateStoreProvider.SetClientManager(this.clientManager);
}

protected void Application_End()
{
    this.clientManager.Dispose();
}
micahasmith commented 10 years ago

Oh man i can't believe I missed that.

Thx!

TheCloudlessSky commented 10 years ago

No problem :smile:.