add support for no referer in login and all the other request has referer.

also - fixed a bug with cookie folder does not exist.