Fixed the persistent cookie code
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.
Check the expiration date of persistent cookies too
Merge pull request #11 from mehrdada/master

Fix cookie persistence issue. (Issue #10)