Fix bug being logged out when using links.