Add a rememberme cookie

Add a rememberme cookie to keep the user logged in across sessions.
Merge remote-tracking branch 'upstream/master'