fixing secure cookie test with a sleep