Fixed the cookie persistence issue. (Issue #10)

The cookie expiration date should be set only if the cookie is
persistent, not the other way around.  The previous code did
exactly the opposite.

This is a fix for issue #10