i am using react cookie for storing the tokens in the cokies..can any one tell me..how to clear cookies when used logout..
import React, { Component } from 'react';
import { withCookies } from 'react-cookie';
class Dashboard extends Component {
constructor(props) {
super(props);
this.state = {
}
this.logout = this.logout.bind(this)
}
logout = (e) => {
cookies.remove('Token');
window.location.href = '/';
}
render() {
return (
<div className="Dashboard">
<div>Dashboard</div>
<button onClick={this.logout}>Logout</button>
</div>
);
}
}
export default withCookies(Dashboard);