Login timeout

Fix login timeout problems https://www.pivotaltracker.com/story/show/82441672

Also fixed some staging environment configuration.