Welcome Guest, Not a member yet? Register   Sign In
Cookies in Google Chrome not created from time to time [SOLVED]
#1

(This post was last modified: 04-27-2022, 12:15 AM by InsiteFX.)

Hi all,
Since few days I observed strange behaviour in Google Chrome connected with Cookies.

I have three environments:
- HTTPS://somedomain.com (release env)
- HTTP://dev.somedomain.com (development env)
- HTTP://demo.somedomain.com (development env for demo)


Example:
A. for development env. (HTTP://dev.somedomain.com and HTTP://demo.somedomain.com)
- On Monday everything works fine
- On Thursday Google Chrome removes session cookie "ci_session" (cookie disapeared) and webapp cannot regenerate it again anymore
- When I clear Google Chrome browsing data everything back to normal but the situation repeats in couple days

B. for release env. (HTTPS://somedomain.com)
- problem not exists
- even If I manualy remove session cookie "ci_session" webapp regenerate it without problems

C. for local env (HTTP://localhost)
- problem not exists
- even If I manualy remove session cookie "ci_session" webapp regenerate it without problems


My comments:
It seems that the problem exists:
- only in Google Chrome (not in Safari, Opera, Edge, Firefox)
- only for HTTP and not for HTTPS protocol
- OR/AND only for subdomain (but I am not sure if it is true)
- exits for webapp installed on the internet (hosted server)
- not exists when I run webapp localy installed on my PC development env.
- problem occured on 2 different PCs with Win10 & Chrome


Please help:
- Any ideas how to handle this issue?
- Where to search the reason?
- What I can check?
- Any suggestion can be helpful



My configuration:
- Windows 10
- newest Google Chrome
- Web app on hosting server (not local)
- PHP 7.4
- CogeIgniter 3.1.11
- config.php:
  $config['sess_driver'] = 'files';
  $config['sess_cookie_name'] = 'ci_session';
  $config['sess_expiration'] = 86400; //=24h (1h=3600)
  $config['sess_save_path'] = NULL;
  $config['sess_match_ip'] = FALSE;
  $config['sess_time_to_update'] = 300;
  $config['sess_regenerate_destroy'] = FALSE;

  $config['cookie_prefix'] = '';
  $config['cookie_domain'] = '';
  $config['cookie_path'] = '/';
  $config['cookie_secure'] = FALSE;
  $config['cookie_httponly'] = FALSE;
Reply
#2

After discussion with Google help desk I can say that this is not strict problem with CI but with situation when we have at least two independed webapps on two (sub)domains: one of them is using SSL (https) and another not (http):

https://maindomain.com
http://demo.maindomain.com

The workaround is to use SSL on both domains.
Reply
#3

Please in the future when you resolve your problem add [SOLVED] to your topic title
I did it for you here so that you can see how it is done.

Thank you
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply




Theme © iAndrew 2016 - Forum software by © MyBB