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: 
To be more precise, add `exp` attribute in your data object where `exp` is expiry time in unix format. 

e.g.

```
var data = {"data":["some data"],exp:16872131302}
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);
};

```
Use jsonwebtoken instead.

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

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

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

```