apply @LukasReschke's cookie changes, hopefully finally fix #854
Set path in cookie.
Merge pull request #3985 from owncloud/cookie-past2

apply @LukasReschke's cookie changes, hopefully finally fix #854