# CakeDC Users plugin: redirecting issue with Logout page

**URL:** <https://discourse.cakephp.org/t/cakedc-users-plugin-redirecting-issue-with-logout-page/5365>\
**Category:** Need Help\
**Created:** [December 5, 2018, 7:57pm UTC](https://discourse.cakephp.org/t/cakedc-users-plugin-redirecting-issue-with-logout-page/5365 "2018-12-05T19:57:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mben](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/mben/32/1099_2.png) [@mben](https://discourse.cakephp.org/u/mben)\
**Post date:** [December 5, 2018, 7:57pm UTC](https://discourse.cakephp.org/t/cakedc-users-plugin-redirecting-issue-with-logout-page/5365/1 "2018-12-05T19:57:05Z")

</div>

I use CakeDC users plugin, and I have an Element : menu.ctp, in which I have some code like this:

> ```
> <?php if (!empty($isLogged)): ?>
> <div class="navbar-collapse collapse">
> <ul class="nav navbar-nav">
> <li><?= $this->html->link('Clients', array('controller'=>'Clients', 'action' => 'index', 'plugin' => null))?></li>
> </ul>
> <ul class="nav navbar-nav">
> <li><?= $this->html->link('Assets', array('controller'=>'Assets', 'action' => 'index', 'plugin' => null))?></li>
> </ul>
> <ul class="nav navbar-nav">
> <li><?= $this->html->link('KACE', array('controller'=>'Machines', 'action' => 'index', 'plugin' => null))?></li>
> </ul>
> <ul class="nav navbar-nav">
> <li><?= $this->html->link('Rooms', array('controller'=>'Rooms', 'action' => 'index', 'plugin' => null))?></li>
> </ul>
> <ul class="nav navbar-nav">
> <li><?= $this->html->link('Departments', array('controller'=>'Departments', 'action' => 'index', 'plugin' => null))?></li>
> </ul>
> <ul class="nav navbar-nav">
> <li><?= $this->html->link('Reports', array('controller'=>'Pages', 'action' => 'reports', 'plugin' => null))?></li>
> </ul>
> <?php if($isLogged['is_superuser']) { ?>
> <ul class="nav navbar-nav">
> <li><?= $this->Html->link(__('Users'), ['plugin' => 'CakeDC/Users','controller' => 'Users','action' => 'index']) ?></li>
> </ul>
> <?php } ?>
> <ul class="nav navbar-nav navbar-right">
> <li class="nav-item dropdown">
> <a class="nav-link dropdown-toggle" href="#" id="navbardrop" data-toggle="dropdown">
> <span><b><?= h($isLogged['first_name'] . ' ' . $isLogged['last_name']) ?>
> <?php if($isLogged['is_superuser']) { ?>(Admin)<?php } ?>
> </b></span>
> </a>
> <div class="dropdown-menu">
> <a class="dropdown-item" href="users/users/change-password">&nbsp;&nbsp;&nbsp;Change Password</a>
> <br>
> <a class="dropdown-item" href="users/users/logout">&nbsp;&nbsp;&nbsp;Logout</a>
> </div>
> </li>
> </ul>
> </div><!--/.nav-collapse -->
> <?php endif; ?>
> 
> ```

The logout url is not working perfectly, from all pages. Sometimes it becomes:  
The right link should be: [http://localhost/project/users/users/logout](http://localhost/project/users/users/logout)  
but in some cases, I get:  
[http://localhost/project/assets/users/users/logout](http://localhost/project/assets/users/users/logout)  
[http://localhost/project/pages/users/users/logout](http://localhost/project/pages/users/users/logout)  
etc.

I know that the issue is this line:  
href=“users/users/logout”\>&nbsp;&nbsp;&nbsp;Logout

but I failed to fix it.

---

<div class="post-metadata">

**Author:** ![Zuluru](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/zuluru/32/1230_2.png) [@Zuluru](https://discourse.cakephp.org/u/Zuluru)\
**Post date:** [December 6, 2018, 2:49am UTC](https://discourse.cakephp.org/t/cakedc-users-plugin-redirecting-issue-with-logout-page/5365/2 "2018-12-06T02:49:41Z")

</div>

You are using relative URLs instead of absolute (i.e. they don’t start with `/`). But why are you hard-coding any of that instead of using the HTML helper like you do above?

```auto
<?= $this->Html->link(__('Change Password'), ['plugin' => 'CakeDC/Users','controller' => 'Users','action' => 'change_password']) ?>

```
