Question: I just implemented jwt-simple,on my backend in nodejs.i want to expire token by given time. 

```
 var jwt = require('jwt-simple');
    Schema.statics.encode = (data) => {
    return JWT.encode(data, CONSTANT.ADMIN_TOKEN_SECRET, 'HS256');
};
Schema.statics.decode = (data) => {
    return JWT.decode(data, CONSTANT.ADMIN_TOKEN_SECRET);
};

```

**how to add expires time in jwt-simple**

Answer: 
There is no default `exp`. Two ways you can add it mannually:

1. With plain js:

iat: Math.round(Date.now() / 1000),
exp: Math.round(Date.now() / 1000 + 5 \* 60 \* 60)
2. With `moment.js`:

iat: moment().unix(),
exp: moment().add(5, 'hours').unix()

[Source](https://github.com/hokaccha/node-jwt-simple/issues/50) from original Github repository.
Use jsonwebtoken instead.

<https://github.com/auth0/node-jsonwebtoken>

```
const jwt = require(`jsonwebtoken`)

const token = jwt.sign({
  data: 'foobar'
}, 'secret', { expiresIn: '1h' });

```