Temporarily fix secure cookie handling

Prior to review/merge of a fix for 7666, temporarily fix secure cookie handling for use in our test suites.