Secure cookie implementation

ref: https://github.com/nextcloud/server/issues/6767