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

API design concepts of session #69

Open
shelling opened this issue Jan 4, 2013 · 0 comments
Open

API design concepts of session #69

shelling opened this issue Jan 4, 2013 · 0 comments

Comments

@shelling
Copy link

shelling commented Jan 4, 2013

In the chapter "Cross Domain Sessions", the session API was designed as

POST /session - Login - Sets the session username and returns a csrf token for the user to use
DELETE /session - Logout - Destroys the session and regenerates a new csrf token if the user wants to re-login
GET /session - Checks Auth - Simply returns if auth is true or false, if true then also returns some session details

However, The express application declares

app.del('/session/:id', function(req, res, next) { ... })

where :id is the session.id which has been passed in cookies

Actually, the browser should have one and only one session in this site. So, the :id in this API is not necessary.

IMHO, to prevent the conflict, It's better to declare SessionModel with the attribute { url: "/session" } rather than { urlRoot: "/session" }, so that the express application can declare

app.del('/session', function(req, res, next) { ... } )

As the design document mentioned above.

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

No branches or pull requests

1 participant