You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$token = Yii::$app->jwt->getBuilder()->setIssuer(Yii::$app->params['issuer'])// Configures the issuer (iss claim)
->setId(Yii::$app->params['token_id'], true)// Configures the id (jti claim), replicating as a header item
->setIssuedAt(time())// Configures the time that the token was issue (iat claim)
->setExpiration(0)// Configures the expiration time of the token (exp claim) NEVEREXPIRED
->set('username', $params['username'])
->set('password', $params['password'])// Configures a new claim, called "uid"
->sign($signer,Yii::$app->params['secret_key'])
->getToken(); // Retrieves the generated token
Although expression setExpiration() is taken 0 or omitted, $token still expired. Could anyone find anyways to solve this problem. Thanks.
The text was updated successfully, but these errors were encountered:
I've tried to set JWT token that never expired.
Although expression setExpiration() is taken 0 or omitted, $token still expired. Could anyone find anyways to solve this problem. Thanks.
The text was updated successfully, but these errors were encountered: