-
Notifications
You must be signed in to change notification settings - Fork 19
Session management
Guess what, session management in whirlwind is already set up for you. You just have to use it. Ain't that cool?
This exposition on session management would be based on the Quickstart tutorial. So it might better to finish the quickstart tutorial first. But if you can't, I believe you can still cope.
At the end of the Quickstart, we could view two pages localhost:8000/ and localhost:8000/display/info/mvc. First, navigate to localhost:8000/. You should see the links log-in and sign-up at the top of the page. You should sign up. This stores your credentials in a mongoDB collection for users. Afterwards, you should sign in with your registered credentials. This creates a new session for the current user (you!). You should see your name on the top of the page indicating that your session is currently active. You should see the same thing in both pages: localhost:8000/, localhost:8000/display/info/<whatever> (if you set up the controller to handle the request to this URI as in the Quickstart tutorial).
As I said in the last paragraph, your sessions in whirlwind are managed in mongoDB. But you could also manage your sessions in either memcache or in redis via the memcache and redis middleware in whirlwind. For more information on middleware, check out our wiki on the middleware plugin system in whirlwind. In subsequent paragraphs, we'll cover how to use redis and memcache for session management in whirlwind.
For now, memcache and redis aren't working properly. We'll fix this problem as soon as possible.