simplify ways to detect cookie