Magento Admin creating two cookies and unable to login when one cookie present

403 views Asked by At

I have a strange issue where I can't login to the Magento 1.8 admin panel.

It is completely looping back to the login box.

It appears to be an issue with cookies. I have changed the session (in local.xml) to use the db:

<session_save>db</session_save>

When trying to login to admin, it is creating one cookie:

Name    adminhtml
Value   ohihrbskueri2hoos8v58pgkd7
Host    sub.domain.com
Path    /
Expires Wed, 18 May 2022 17:33:10 GMT
Secure  No
HttpOnly No

If this cookie is present, then I can login ok.

What I've noticed is that when I log back out, it then creates a second cookie:

Name    adminhtml
Value   j3ljtmidn3arlghj7ev5u9c4o4
Host    .sub.domain.com
Path    /
Expires Wed, 18 May 2022 17:34:30 GMT
Secure  Yes
HttpOnly No

The most noticeable difference with the second cookie is the host. It has a full stop at the beginning of the domain. If I delete this cookie, I can login ok.

I need to work out why/where this cookie is being created

1

There are 1 answers

0
RustyIngles On

I've worked out the answer.

I needed to set the cookie domain (System > Configuration > General >Web) to:

.sub.domain.com

I'm assuming this then stops the duplicate cookie from being generated as it's using the same domain.