I tried all above (almost) and it did not work until I noticed I neglected setting expiration data. Turns out browser do not persist the cookie between sessions in that case