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.
in place "expires in" use key name as "iat"...hope it will work