Skip to content
This repository has been archived by the owner on Sep 14, 2022. It is now read-only.

Allow Configuration for Session Key #66

Closed
rdegges opened this issue Apr 1, 2015 · 2 comments
Closed

Allow Configuration for Session Key #66

rdegges opened this issue Apr 1, 2015 · 2 comments
Assignees

Comments

@rdegges
Copy link
Contributor

rdegges commented Apr 1, 2015

Hi all!

I'm currently building an authentication library, which ships with pre-built registration and login forms. Because of this, my library uses this csurf module to protect the form inputs.

My library initializes it's own session management stuff (to maintain user state), using the node-client-sessions library from Mozilla (https://github.com/mozilla/node-client-sessions), which allows me to specify a custom request session key.

So for instance, I can use that library to initialize ONE session as req.stormpathSession, and another as req.session.

I like doing this because this way -- my library does its own session stuff under req.stormpathSession, while the user USING my library can create / do their own session stuff as req.session, which is sort of the convention.

Anyhow: back to my original point. What I'd like is for this ilbrary to support custom session keys. This way, I could tell the csurf middleware to write data to req.stormpathSession instead of the default req.session. This would make it possible for my sort of use case to work.

If this is cool with ya'll, and you'll merge it in, I'd be happy to submit a clean patch supporting this behavior along with full tests / etc.

Let me know if this sounds OK!

@dougwilson
Copy link
Contributor

I don't have any objections.

@dougwilson dougwilson self-assigned this Apr 1, 2015
@rdegges
Copy link
Contributor Author

rdegges commented Apr 1, 2015

Awesome, I'll start work on this today =) Appreciate your fast response by the way!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants