updated secure cookie fix from master