Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added MaxLength support to RediStore #5

Merged
merged 1 commit into from
Oct 18, 2013
Merged

Added MaxLength support to RediStore #5

merged 1 commit into from
Oct 18, 2013

Conversation

elithrar
Copy link
Contributor

Added MaxLength support to RediStore to allow for larger session values. Tests included. Triggered from #4 and gorilla/sessions#17

As per gorilla/sessions#2 - this allows a session to exceed the 4096-byte limit commonly enforced by cookie-based stores. Redis has a much larger limit: typically 512MB - http://redis.io/topics/data-types.

@elithrar
Copy link
Contributor Author

PS: We'll need to wait for @kisielk to merge his PR (as linked) upstream first.

@@ -62,6 +62,17 @@ func (s *RediStore) Close() {
s.Pool.Close()
}

// MaxLength restricts the maximum length of new sessions to l.
// If l is 0 there is no limit to the size of a session, use with caution.
// The default for a new FilesystemStore is 4096.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RediStore

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed this up and squashed the commits.

@kisielk
Copy link
Collaborator

kisielk commented Oct 17, 2013

@boj If this seems like a good idea to you, I'll merge the FilesystemStore changes.

values. Tests included.

As per gorilla/sessions#2 - this allows a
session to exceed the 4096-byte limit commonly enforced by cookie-based
stores. Redis has a much larger limit: typically 512MB -
http://redis.io/topics/data-types.
@boj
Copy link
Owner

boj commented Oct 18, 2013

@elithrar @kisielk Sounds great to me. I haven't hit the limit yet so it never occurred to me, but clearly a necessary change.

@kisielk
Copy link
Collaborator

kisielk commented Oct 18, 2013

I've merged the corresponding change in sessions, so go ahead.

boj added a commit that referenced this pull request Oct 18, 2013
Added MaxLength support to RediStore
@boj boj merged commit adaeced into boj:master Oct 18, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants