This topic contains a post which is marked as Best Answer. Press here if you would like to see it.
*

Ivanko

  • *****
  • 391 posts
subdomain issue Osclass 8.2.1 (COOKIE_DOMAIN)
« on: December 13, 2023, 09:35:20 AM »
If I add into config.php
define('COOKIE_DOMAIN', '.domain.com');
I am unable to login into admin panel

Does anybody have experience on it ?

« Last Edit: December 13, 2023, 10:50:13 AM by MB Themes »

*

MB Themes

Re: subdomain issue Osclass 8.2.1
« Reply #1 on: December 13, 2023, 10:25:17 AM »
Do you have your site on domain.com?
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

Ivanko

  • *****
  • 391 posts
Re: subdomain issue Osclass 8.2.1
« Reply #2 on: December 13, 2023, 10:45:37 AM »
it fixed it needs to be without a DOT  :'( :'(

*

MB Themes

Re: subdomain issue Osclass 8.2.1 COOKIE_DOMAIN
« Reply #3 on: December 13, 2023, 10:50:04 AM »
I am not sure if in that case are cookies really shared across  all subdomains.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

Ivanko

  • *****
  • 391 posts
Re: subdomain issue Osclass 8.2.1 (COOKIE_DOMAIN)
« Reply #4 on: December 13, 2023, 11:02:06 AM »
I mean this one is not working

define('COOKIE_DOMAIN', '.domain.com');

this look ok

define('COOKIE_DOMAIN', 'domain.com');

*

MB Themes

Re: subdomain issue Osclass 8.2.1 (COOKIE_DOMAIN)
« Reply #5 on: December 13, 2023, 11:23:46 AM »
I know, but checking on internet about COOKIE_DOMAIN , some people says there should be dot, another that there should not be dot.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

Ivanko

  • *****
  • 391 posts
Re: subdomain issue Osclass 8.2.1 (COOKIE_DOMAIN)
« Reply #6 on: December 13, 2023, 11:32:25 AM »
if I use DOT I can not login into oc-admin, in clean browser, may be there is a bug in core ?
without a DOT it is working well, but I am not sure, as you said if it will works as intended for all site without a DOT  :o

Marked as best answer by frosticek on December 13, 2023, 01:42:10 PM
*

MB Themes

Re: subdomain issue Osclass 8.2.1 (COOKIE_DOMAIN)
« Reply #7 on: December 13, 2023, 01:42:07 PM »
Ok so correct is:
Code: [Select]
define('COOKIE_DOMAIN', 'yoursite.com');  (it's like that in sample config)

Osclass then set cookies on domain yoursite.com
Sample:
Code: [Select]
setcookie($var, null, -1, REL_WEB_URL, COOKIE_DOMAIN);
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

Wiz

  • ****
  • 153 posts
Re: subdomain issue Osclass 8.2.1 (COOKIE_DOMAIN)
« Reply #8 on: December 19, 2023, 01:07:41 AM »
The guidelines are to use .domain.com when wanting to enable same cookie on root and subdomains of that root, and without dot for cookie use on single domains only (per root OR subdomain cookie).

Under osclass and the way session handling was built, it's sufficient to use domain.com for both root AND subdomain use.

If you're having issues then check your php config.