Optionally access mod cookie in JavaScript