RESTful can be used as a guideline for constructing URLs, and you can make sessions and users resources:
GET /session/new
gets the webpage that has the login formPOST /session
authenticates credentials against databaseDELETE /session
destroys session and redirect to /GET /users/new
gets the webpage that has the registration formPOST /users
records the entered information into database as a new /user/xxxGET /users/xxx
// gets and renders current user data in a profile viewPOST /users/xxx
// updates new information about user
These can be plural or singular (I’m not sure which one is correct). I’ve usually used /users
for a user index page (as expected), and /sessions
to see who is logged in (as expected).
Using the name in the URL instead of a number (/users/43
vs. /users/joe
) is usually driven by the desire to be more friendly to the users or search engines, not any technical requirements. Either is fine, but I’d recommend you are consistent.
I think if you go with the register/login/logout or sign(in|up|out)
, it doesn’t work as well with the restful terminology.