added login cookie code

need current version, cause my current build is broken