Fixed cookie based login for installations without mcrypt

bug #4469

Signed-off-by: Michal Čihař <michal@cihar.com>