Set cookie on successful login

 - the cookie needs to be set otherwise the user will not stay logged in
   after the initial login
Merge pull request #3 from jerrykan/master

Set cookie on successful login