Fix session security problem while login

This patch adds the session config in user's config file. And validate
the request against the session config.
Merge pull request #5 from wb14123/session-improve-fix

Fix session security problem while login