session: properly set cookies when given FQDN

Fixes #762
Closes #763