Helper routine for session in a cookie pattern.