No Code Attached Yet
avatar AndySDH
AndySDH
9 Oct 2020

Joomla cookies are assigned to root path even if site is in a subfolder.

This means that if you have several Joomla installations under one domain, they will all use the same cookies and, for example, "think" that your joomla_user_state is "logged_in" in all sites even if it may be just logged in one site.

This can create all kind of conflicts and unexpected behaviors.

Steps to reproduce the issue

  1. Create a Joomla site in a subdirectory such as www.mysite.com/joomlainstall/
  2. After logging in, check the stored cookies (joomla_user_state, session cookie, joomla_remember_me...)

Expected result

They should be assigned to the proper root path of the specific installation "/joomlainstall/"

This allows you to have separate cookies for each separate installation under the same domain.

Actual result

They are currently assigned to the root path of the whole domain "/"

avatar AndySDH AndySDH - open - 9 Oct 2020
avatar joomla-cms-bot joomla-cms-bot - change - 9 Oct 2020
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 9 Oct 2020
avatar AndySDH AndySDH - change - 9 Oct 2020
The description was changed
avatar AndySDH AndySDH - edited - 9 Oct 2020
avatar SharkyKZ
SharkyKZ - comment - 9 Oct 2020

Have you tried setting Cookie Path in Global Configuration?

avatar AndySDH
AndySDH - comment - 9 Oct 2020

@SharkKZ I haven't, but I guess that's for custom uses.

By default it should definitely default to the path of the Joomla installation rather than the root of the domain, otherwise you would have to customize it on each site manually.

avatar Bakual
Bakual - comment - 9 Oct 2020

That's exactly the setting you need and it defaults to root because that is usually the right value for most sites.

avatar joomdonation joomdonation - close - 12 Nov 2022
avatar joomdonation
joomdonation - comment - 12 Nov 2022

As answered by @SharkyKZ and @Bakual , you can use Cookie Path to handle this use case when it is needed. For now, I'm closing this issue.

avatar joomdonation joomdonation - change - 12 Nov 2022
Status New Closed
Closed_Date 0000-00-00 00:00:00 2022-11-12 14:30:56
Closed_By joomdonation
Labels Added: No Code Attached Yet
Removed: ?

Add a Comment

Login with GitHub to post a comment