This change causes a regression in logout. Because $tmp is set to the referer, and referers are not set during redirections. I will commit a fix
mentioned in commit 2816586a