Added optional domain for authentication cookie

This allows a user to specify the domain for the authentication cookie, useful for applications running in multiple sub domains.