Server: fix the cookie expiration

This PR fix the cookie expiration time. It something we missed in the setup of the session cookie.
The `duration` option is for the server while `cookie.maxAge` is the expiration date.

I observed a weird failure during the functional tests. I hope it won't turns into a intermittent failure.
Hence, I propose to run the travis build multiple time before landing this.