# Session not working (cakephp 2.8)

**URL:** <https://discourse.cakephp.org/t/session-not-working-cakephp-2-8/5086>\
**Category:** Uncategorized\
**Created:** [October 11, 2018, 7:02am UTC](https://discourse.cakephp.org/t/session-not-working-cakephp-2-8/5086 "2018-10-11T07:02:22Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![neerajrawat](https://avatars.discourse-cdn.com/v4/letter/n/ba9def/32.png) [@neerajrawat](https://discourse.cakephp.org/u/neerajrawat)\
**Post date:** [October 11, 2018, 7:02am UTC](https://discourse.cakephp.org/t/session-not-working-cakephp-2-8/5086/1 "2018-10-11T07:02:22Z")

</div>

Hi , I have put my cakephp framework inside subdomain ,

after this my logged in session is not working ,

---

<div class="post-metadata">

**Author:** ![Megslalk](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/megslalk/32/712_2.png) [@Megslalk](https://discourse.cakephp.org/u/Megslalk)\
**Post date:** [October 11, 2018, 7:09am UTC](https://discourse.cakephp.org/t/session-not-working-cakephp-2-8/5086/2 "2018-10-11T07:09:46Z")

</div>

Hi!

Could you share more information on what you have tried and the errors you are getting?

---

<div class="post-metadata">

**Author:** ![neerajrawat](https://avatars.discourse-cdn.com/v4/letter/n/ba9def/32.png) [@neerajrawat](https://discourse.cakephp.org/u/neerajrawat)\
**Post date:** [October 11, 2018, 7:15am UTC](https://discourse.cakephp.org/t/session-not-working-cakephp-2-8/5086/3 "2018-10-11T07:15:37Z")

</div>

I’m using cakephp version 2.8 , uploaded my code in inside a folder in named as app , app is a subdomain like [app.hello.com](http://app.hello.com). so after uploading my code inside this folder session stop working.  
I did not understand this , is this because I have directory now /public\_html/app/app/Config

---

<div class="post-metadata">

**Author:** ![Megslalk](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/megslalk/32/712_2.png) [@Megslalk](https://discourse.cakephp.org/u/Megslalk)\
**Post date:** [October 11, 2018, 7:29am UTC](https://discourse.cakephp.org/t/session-not-working-cakephp-2-8/5086/4 "2018-10-11T07:29:40Z")

</div>

Cool, could you share a bit more so that someone can help you? such as what errors, what server software you are using, what his config looks like etc

---

<div class="post-metadata">

**Author:** ![neerajrawat](https://avatars.discourse-cdn.com/v4/letter/n/ba9def/32.png) [@neerajrawat](https://discourse.cakephp.org/u/neerajrawat)\
**Post date:** [October 11, 2018, 7:37am UTC](https://discourse.cakephp.org/t/session-not-working-cakephp-2-8/5086/5 "2018-10-11T07:37:39Z")

</div>

I’m using Nginx server . And no I did not receiving any error , my problem is after logout , I can directly access previous page, which is should not be happen, it should redirect me on login page.

---

<div class="post-metadata">

**Author:** ![MarceliSzpak](https://avatars.discourse-cdn.com/v4/letter/m/4af34b/32.png) [@MarceliSzpak](https://discourse.cakephp.org/u/MarceliSzpak)\
**Post date:** [October 11, 2018, 12:58pm UTC](https://discourse.cakephp.org/t/session-not-working-cakephp-2-8/5086/6 "2018-10-11T12:58:19Z")

</div>

It’s related to cookie domain and path. Clear cookies , then use some web browser extension to see what cookies were set and for what domain. I guess you set cookie for [app.hello.com](http://app.hello.com) and you try to delete cookie for [hello.com](http://hello.com) or the other way around. Then try to logout and check cookies again. If you do not find any good solution then hacking cake session handler will be last option to try.

---

<div class="post-metadata">

**Author:** ![FinlayDaG33k](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/finlaydag33k/32/1049_2.png) [@FinlayDaG33k](https://discourse.cakephp.org/u/FinlayDaG33k)\
**Post date:** [October 11, 2018, 3:10pm UTC](https://discourse.cakephp.org/t/session-not-working-cakephp-2-8/5086/7 "2018-10-11T15:10:13Z")

</div>

> [@MarceliSzpak](#):
>
> web browser extension

Most modern webbrowsers (eg. Chrome and Firefox) come with this feature build in.

---

<div class="post-metadata">

**Author:** ![neerajrawat](https://avatars.discourse-cdn.com/v4/letter/n/ba9def/32.png) [@neerajrawat](https://discourse.cakephp.org/u/neerajrawat)\
**Post date:** [October 12, 2018, 10:47am UTC](https://discourse.cakephp.org/t/session-not-working-cakephp-2-8/5086/8 "2018-10-12T10:47:27Z")

</div>

Thank for your feedback , but it not browser specific , logout feature did not killing my session. Also after login screen when I jump on another screen session variables are lost.

---

<div class="post-metadata">

**Author:** ![MarceliSzpak](https://avatars.discourse-cdn.com/v4/letter/m/4af34b/32.png) [@MarceliSzpak](https://discourse.cakephp.org/u/MarceliSzpak)\
**Post date:** [October 12, 2018, 3:45pm UTC](https://discourse.cakephp.org/t/session-not-working-cakephp-2-8/5086/9 "2018-10-12T15:45:31Z")

</div>

You meant to use browser to see if issue is related to what I mentioned.

---

<div class="post-metadata">

**Author:** ![susantakdas](https://avatars.discourse-cdn.com/v4/letter/s/c0e974/32.png) [@susantakdas](https://discourse.cakephp.org/u/susantakdas)\
**Post date:** [June 19, 2019, 6:47am UTC](https://discourse.cakephp.org/t/session-not-working-cakephp-2-8/5086/10 "2019-06-19T06:47:45Z")

</div>

Same problem when i try to firefox that time session not working. but in chrome working fine. any one help me?
