title: How to create logout function in Ionic 2+
body: <p>I would like to create a logout button in my Ionic 2+ application.</p>
  
  <p>My problem is this:</p>
  
  <p>When I click on the logout button on ProfilePage, I get a redirect to WelcomePage and then there is a second redirect back to ProfilePage (which is the page where the logout button is located).</p>
  
  <p>How can I block this second redirect?</p>
  
  <p>Here is my html code : </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>        &lt;/p&gt;
          &lt;a href="#" (click)="logout()" button ion-button block color="danger" icon-start&gt;
              &lt;ion-icon name='log-out'&gt;&lt;/ion-icon&gt;
              Se déconnecter
          &lt;/a&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>And my JS function:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>    logout(){
        this.navCtrl.push('WelcomePage');
      }</code></pre>
  </div>
  </div>
  </p>
  
  <p>Thanks in advance for your help </p>