alexedwards / scs

HTTP Session Management for Go
MIT License
2.14k stars 166 forks source link

Memcached support? #18

Closed justinclift closed 6 years ago

justinclift commented 7 years ago

Looking around for a new session manager, one which supports memcached.

SCS looks interesting and is written for modern Go (unlike Gorilla), but doesn't (yet) support memcached.

Any plans on memcached support? :smile:

alexedwards commented 7 years ago

I don't see any reason there couldn't be a memcached engine.

I'll add one when I've got time, or if you'd like to send a PR that would be very welcome!

justinclift commented 7 years ago

No worries @alexedwards. I'll take a look at doing a PR, but not sure yet. Got an initial implementation using gorilla/sessions + bradpeabody's memcached store working yesterday, so going to try with that first.

We're using Go 1.8 atm (and likely 1.9 soon), which the docs on gorilla/sessions sound like it has issues with. So, may need to investigate alternatives shortly, in which case... a PR will be created. :wink:

justinclift commented 7 years ago

Co-incidentally, it's interesting your personal home page mentions data.police.uk.

That's one of the data sources I've been looking at mirroring as example data, for the project I'm implementing memcached sessions for (dbhub.io).

alexedwards commented 7 years ago

Yep, myself and @rkhleics worked on data.police.uk for many years. It's a good resource.

Out of interest, what's the potential problem with gorilla/session and v1.9? I couldn't find any notes about it.

justinclift commented 7 years ago

Well, the gorilla/sessions readme seems to say that people running Go 1.7+ and not using gorilla/mux will need to add gorilla/context to their imports list, plus do some stuff with gorilla/context.ClearHandler() in order to avoid leaking memory.

The gorilla/context readme pretty clearly says it's deprecated and conflicts with Golang 1.7+'s inbuild context package.

Which makes things sound like running gorilla/sessions with Golang 1.7+ is a bad idea. Which I'll probably find out shortly, as I'm setting things up now for some basic validation / load testing. :smile:

royallthefourth commented 6 years ago

This should be ready to go, just waiting on approval of my PR

justinclift commented 6 years ago

Excellent @royallthefourth, well done. :smile: