Question: how to check whether my token is expired or not?

```
var token = jwt.sign(user,app.get('superSecret'),{
    expiresIn : 2
});

```

Answer: 
I assume you are using the jsonwebtoken package that is [documented here](https://github.com/auth0/node-jsonwebtoken#tokenexpirederror "documented here")

If that is the case, have a look at the `jwt.verify` method:

```
jwt.verify(token, 'shhhhh', function(err, decoded) {
  if (err) {
    /*
      err = {
        name: 'TokenExpiredError',
        message: 'jwt expired',
        expiredAt: 1408621000
      }
    */
  }
});

```

In short words: Check the error of that method. If it is the TokenExpiredError then, guess what... the token is expired.
You need set the host current time to compare the expiration date in the verify function example:

`jwt.verify(token, JWT.SECRET_KEY, {clockTimestamp: new Date().getTime()}, callback)`

the clockTimestamp property is required to set the host current time.