PR for #6673. Allow to set DateTimeObject for SetCookie Expires 

PR for #6673
Alignment to other parameters. `\DateTime` can be imported so `DateTime` can be used instead of `\DateTime` (also for all other instances in this file and the test file).