boj/redistore — pull request #12 by robert-zaremba (2014-03-25 11:23:33+00:00)
Title: Added a way to configure storage MaxAge.

Current implementation suffers for inconsistent way of handling `MaxAge`.
On one side we have `RediStore.Options.MaxAge` as a `session.Options` used by redis TTL and browser MaxAge/Expire.
On the other side we use `securecookie.SecureCookie` as a default codec. It has it's own maxAge config, which is not connected to the one from `RediStore.Options`.
When the former one is bigger then the letter one we encounter a nasty issue, where the cookie is active both in a browser and storage, but `SecureCookie` fails to decode it because of timestamp restriction related to `SecureCookie.maxAge`.

In this pull request I've added two commits:

* extract a common part of `NewRediStore*` funcitons
* handle an issue with MaxAge described above (more info in commit message).

Also I'm opt to hide `RediStore.Options` (to change it to `RediStore.options`). Of course session object will expose it, but at least we could have a consistent way to set storage configuration in a *checked* way.