title: clear token cookie using react js after logout
body: <p>i am using react cookie for storing the tokens in the cokies..can any one tell me..how to clear cookies when used logout..</p>
  
  <pre><code>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) =&gt; {
  
          cookies.remove('Token');
          window.location.href = '/';
      }
  
      render() {
          return (
              &lt;div className="Dashboard"&gt;
                  &lt;div&gt;Dashboard&lt;/div&gt;
                  &lt;button onClick={this.logout}&gt;Logout&lt;/button&gt;
              &lt;/div&gt;
          );
      }
  }
  export default withCookies(Dashboard);
  </code></pre>