Comments (9)
I think that having an example of how to use SCS with Echo would be valuable.
I'm not keen on adding an examples folder for two reasons: first it clutters the repository with code that isn't core to the project, and secondly if your using a vendoring tool which supports recursive vendoring (like GVT) it could easily lead to dependencies to be installed which aren't actually used in someone's compiled application (see FiloSottile/gvt#84 for an example).
I think a sensible way to address this is for example code to be published as Gists and linked to from the main README. I've just pushed commit 2b6a87b which adds an examples section and a link to an example.
If you want to add a example of using SCS with Echo, that would be great. I'll update the title of this issue accordingly.
from scs.
Works for me. Thanks!
from scs.
Oh, but sorry.. my middleware depends on Opts()
being exposed. Are you okay with merging pull request #33?
from scs.
It looks like Echo now provides it's own official session middleware which works with the Echo Request
and Response
objects. I think that this would be a better fit for users of Echo instead of trying to shoehorn SCS into their application.
I've updated the README in 4c09049
from scs.
@alexedwards Just to push back lightly-- AFAICT, what echo has done is a thin wrapper for gorilla/sessions.
I compared the pgstore backend available for gorilla/sessions to the one you wrote for scs, and by far, I prefer your approach. The table is simpler, it isn't auto-created, it is properly indexed, and the code is easier to audit and reason about.
So now I'm vexed-- I'd rather use scs, but I don't really want to drop echo, either. @jpfluger is your middleware usable with scs as it now stands?
from scs.
@danielbprice Yes, it should be usable. But it's also 6 commits behind with this repo and different than my local version which I use extensively in my projects. I need to clean that up and might re-fork to save time (you've been warned! :). @alexedwards does a great job maintaining scs so I would prefer to re-integrate with his repo. I'll make time on Sunday to work on this.
from scs.
Sorry to raise a dead issue, but i created Echo SCS Session if anyone is interested in using scs with echo
from scs.
@spazzymoto Thanks, I've added a link to echo-scs-session in the SCS README 👍
from scs.
@spazzymoto Very elegant solution using Echo with SCS. Highly recommended for echo users to check-out Echo SCS Session and adapt to suit your own Echo projects. 🥇
from scs.
Related Issues (20)
- NATs HOT 1
- Ignore GobCodec.Decode errors? HOT 3
- Possible to tag a new version? HOT 2
- Manually Set Token / Session ID? HOT 4
- Add example using gin
- Expose CtxStore interface to allow custom implementation HOT 1
- How to recover from corrupt session data? (or how to Destroy without loading the session) HOT 2
- Fails using ListenAndServeTLS HOT 1
- Sqlite3store error constraint failed: NOT NULL constraint failed: sessions.expiry (1299) HOT 4
- manage all session HOT 1
- Redis example is using a different Redis library HOT 8
- Custom names for sessions tables HOT 3
- support partitioned CHIPS cookies HOT 2
- pgxstore expects a *pgxpool.Pool instead of a *sql.DB HOT 5
- Flush / streaming HOT 2
- *scs.sessionResponseWriter does not implement http.Hijacker HOT 3
- Support Turso and libsql HOT 2
- Session getting added to DB, but not to cookie, when set to SameSiteNone, but works in SameSiteLax HOT 2
- Sign session ids/tokens HOT 5
- 2.7.0 breaks websocket compatibility HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scs.