# Forum Login Issues - Cookie Settings

**URL:** <https://discourse.gaki-no-tsukai.com/t/forum-login-issues-cookie-settings/2315>\
**Category:** Troubleshooting & Help\
**Created:** [21 March 2011 02:33 UTC](https://discourse.gaki-no-tsukai.com/t/forum-login-issues-cookie-settings/2315 "2011-03-21T02:33:08Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jarrod1937](https://discourse.gaki-no-tsukai.com/letter_avatar_proxy/v4/letter/j/848f3c/32.png) [@jarrod1937](https://discourse.gaki-no-tsukai.com/u/jarrod1937)\
**Post date:** [21 March 2011 02:33 UTC](https://discourse.gaki-no-tsukai.com/t/forum-login-issues-cookie-settings/2315/1 "2011-03-21T02:33:08Z")

</div>

I am not sure who the technical forum runner is here, but thought i’d mention a (minor) problem with these forums. If i login, i am logged into [http://www.gaki-no-tsukai.com](http://www.gaki-no-tsukai.com), however, if i am then led to a non-www version of a page on this site (via a link or what have you), i am no longer logged in. For example, log in, then go to: [http://gaki-no-tsukai.com/index.php](http://gaki-no-tsukai.com/index.php), and you’ll see you’re no longer logged in. This is more than likely because the cookie settings for the site is setting the cookie domain as [www.gaki-no-tsukai.com](http://www.gaki-no-tsukai.com).  
This can be fixed in one of two ways:  
1.) Do a canonical redirect to redirect all non-www traffic to the www version of the url.  
2.) Or, set the cookie domain to " .gaki-no-tsukai.com", notice the beginning . which denotes that the cookie is for the domain gaki-no-tsukai AND all possible subdomains of that domain.

It is actually best to do both, for other reasons, but one or the other will fix the cookie issue.

---

<div class="post-metadata">

**Author:** ![Erhan](https://discourse.gaki-no-tsukai.com/user_avatar/discourse.gaki-no-tsukai.com/erhan/32/4_2.png) [@Erhan](https://discourse.gaki-no-tsukai.com/u/Erhan)\
**Post date:** [21 March 2011 10:10 UTC](https://discourse.gaki-no-tsukai.com/t/forum-login-issues-cookie-settings/2315/2 "2011-03-21T10:10:57Z")

</div>



---

<div class="post-metadata">

**Author:** ![jarrod1937](https://discourse.gaki-no-tsukai.com/letter_avatar_proxy/v4/letter/j/848f3c/32.png) [@jarrod1937](https://discourse.gaki-no-tsukai.com/u/jarrod1937)\
**Post date:** [21 March 2011 15:23 UTC](https://discourse.gaki-no-tsukai.com/t/forum-login-issues-cookie-settings/2315/3 "2011-03-21T15:23:00Z")

</div>

Excellent, thanks for fixing it so fast. As i said, it wasn’t a big deal, i just noticed it after i had to log in to view a link, which turned out to be a link to another page of this forum that had other links… but i had to log in again to view those links.  
And yeah, i’ve had difficulty in the past myself with canonical redirects. I usually implement them with mod-rewrite regex rules, but you can implement them within php too (though it gets a bit messy). But i don’t think there is too much of a reason to worry about that since the cookie issue is fixed, that is unless you’re wanting to maximize your search engine traffic.

---

<div class="post-metadata">

**Author:** ![Kanzaki](https://discourse.gaki-no-tsukai.com/user_avatar/discourse.gaki-no-tsukai.com/kanzaki/32/6_2.png) [@Kanzaki](https://discourse.gaki-no-tsukai.com/u/Kanzaki)\
**Post date:** [21 March 2011 16:07 UTC](https://discourse.gaki-no-tsukai.com/t/forum-login-issues-cookie-settings/2315/4 "2011-03-21T16:07:37Z")

</div>

Regex are a nightmare.

---

<div class="post-metadata">

**Author:** ![jarrod1937](https://discourse.gaki-no-tsukai.com/letter_avatar_proxy/v4/letter/j/848f3c/32.png) [@jarrod1937](https://discourse.gaki-no-tsukai.com/u/jarrod1937)\
**Post date:** [21 March 2011 16:20 UTC](https://discourse.gaki-no-tsukai.com/t/forum-login-issues-cookie-settings/2315/5 "2011-03-21T16:20:34Z")

</div>

Most definitely, but very powerful at the same time. I commonly use this:

[http://www.spaweditor.com/scripts/regex/](http://www.spaweditor.com/scripts/regex/)

for regex testing, very useful if you do a lot of pattern matching.

---

<div class="post-metadata">

**Author:** ![Kanzaki](https://discourse.gaki-no-tsukai.com/user_avatar/discourse.gaki-no-tsukai.com/kanzaki/32/6_2.png) [@Kanzaki](https://discourse.gaki-no-tsukai.com/u/Kanzaki)\
**Post date:** [21 March 2011 16:35 UTC](https://discourse.gaki-no-tsukai.com/t/forum-login-issues-cookie-settings/2315/6 "2011-03-21T16:35:07Z")

</div>

Very useful, will definatly ease my php programming.

Thanks!
