Isn't setHeader1 the same as setHeader2 when the user isn't logged in? Why not just use setHeader2 right from the go?