Fixed a TTL function for user login