Replace printStackTrace with logging
Login controller now sets session cookie