Trim string values before trying to parse them as ints.

A minor improvement and the parsing may still fail on several inputs. But it's
all that is needed right now.
Don't store the logged in username in clear text in the cookie.

Good enough for now.
Simply encrypts the username and stores that in the cookie under a secret key.
Will have to revise the full user management and authentication soon anyway.