# Setting headers at the controller view

**URL:** <https://discourse.cakephp.org/t/setting-headers-at-the-controller-view/2428>\
**Category:** Uncategorized\
**Created:** [April 17, 2017, 9:20pm UTC](https://discourse.cakephp.org/t/setting-headers-at-the-controller-view/2428 "2017-04-17T21:20:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jigzat](https://avatars.discourse-cdn.com/v4/letter/j/8491ac/32.png) [@jigzat](https://discourse.cakephp.org/u/jigzat)\
**Post date:** [April 17, 2017, 9:20pm UTC](https://discourse.cakephp.org/t/setting-headers-at-the-controller-view/2428/1 "2017-04-17T21:20:57Z")

</div>

Hello everyone, I’m new to CakePHP but I have been using it for almost a year now. I’m doing some tryouts with a REST API that uses JWT and I’m trying to use the same code for logging into the website. Right now I’m storing the token in a header cookie (set-cookie) and I was wondering if there is a way to set the “Authorization Bearer” from a view without using the httpclient (curl like facility). Or even better set the Authorization header at the controller?

---

<div class="post-metadata">

**Author:** ![jmcd73](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/jmcd73/32/481_2.png) [@jmcd73](https://discourse.cakephp.org/u/jmcd73)\
**Post date:** [April 19, 2017, 1:43pm UTC](https://discourse.cakephp.org/t/setting-headers-at-the-controller-view/2428/3 "2017-04-19T13:43:20Z")

</div>

[https://book.cakephp.org/3.0/en/controllers/request-response.html#setting-headers](https://book.cakephp.org/3.0/en/controllers/request-response.html#setting-headers)
