The checking to know if the token has expired was upside down. The hasExpired function was returning true if $exp was greater than time(). The hasExpired function only should returning true when the $exp is less than or equal time(), that is, when the token has expired.
The checking to know if the token has expired was upside down. The hasExpired function was returning true if $exp was greater than time(). The hasExpired function only should returning true when the $exp is less than or equal time(), that is, when the token has expired.