[go: up one dir, main page]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

$_COOKIE in LEMP doesn't contain all browser's cookie #13

Open
Daisuke-sama opened this issue Mar 27, 2022 · 7 comments
Open

$_COOKIE in LEMP doesn't contain all browser's cookie #13

Daisuke-sama opened this issue Mar 27, 2022 · 7 comments

Comments

@Daisuke-sama
Copy link

I set in my code some important cookies, it is sent into the browser and the browser stores it, also there are XDEBUG and SESSION cookies. But in another load all cookies except xdebug and session. So, I guess that's cache or something else. How to fix that?

@rtfm-47 rtfm-47 added Needs Triage and removed lemp labels Mar 27, 2022
@rtfm-47 rtfm-47 transferred this issue from lando/lando Mar 27, 2022
@labboy0276
Copy link
Contributor

@Daisuke-sama can you tell me how you are setting your cookies in code please.

@Daisuke-sama
Copy link
Author

sure, that's a call like that

setcookie("current_user_id", $user_id, $expire_time, $path);
setcookie("current_user_key", $permission_key, $expire_time, $path);

@labboy0276
Copy link
Contributor

Seems pretty normal. Can I see your .lando.yml file as well @Daisuke-sama

@Daisuke-sama
Copy link
Author
name: crm-web
recipe: lemp
config:
  php: 7.4
  xdebug: "debug,develop"
services:
  appserver:
#    webroot: /var/www/html/crm-stroy
    app_mount: delegated
    build_as_root:
      - "apt -y update && apt-get install -y gnupg2 && echo 'deb https://apt.postgresql.org/pub/repos/apt/ stretch-pgdg main' >> /etc/apt/sources.list.d/pgdg.list && wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - && apt -y update && apt-get install -y postgresql-client-12"
      - rm -f /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini && pkill -o -USR2 php-fpm
    run:
      - test -f /var/www/html && rm /var/www/html
      - ln -s /app /var/www/html
      - test -f ./crm-stroy && rm ./crm-stroy
      - ln -s /app ./crm-stroy
    xdebug: true
    overrides:
      environment:
        APP_ENV: "local"
        XDEBUG_CONFIG: "client_host=host.docker.internal discover_client_host=1 log=/tmp/xdebug.log remote_enable=true remote_host=host.docker.internal client_port=9003 idekey=PHPSTORM"
  database:
    type: postgres:12
    portforward: 54321
    creds:
      database: ---
events:
  post-rebuild:
    - database: psql --version
    - database: psql -h database -U postgres -c "CREATE USER --- WITH ENCRYPTED PASSWORD '---' SUPERUSER;"
    - database: psql -h database -U postgres -c "GRANT ALL PRIVILEGES ON DATABASE --- TO ---;"
    - database: pg_restore -h database -U postgres -w -d --- /app/_dev/---db-2022-01-17.dump
tooling:
  xdebug-on:
    service: appserver
    description: Enable xdebug for nginx.
    cmd: rm -f /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini && docker-php-ext-enable xdebug && pkill -o -USR2 php-fpm && echo "Xdebug enabled"
    user: root
  xdebug-off:
    service: appserver
    description: Disable xdebug for nginx.
    cmd: rm -f /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini && pkill -o -USR2 php-fpm && echo "Xdebug disabled"
    user: root

@labboy0276
Copy link
Contributor

whats the reason you are delegating your app mount on the appserver? Also why are you installing postgres in the appserver when you specify it in the database service? @Daisuke-sama

@Daisuke-sama
Copy link
Author

The delegation is for operative reflecting changes from a container to the host. When I used defaults it also didn't read cookies.
About the Postgres , by any reason without this installation of the postures I cannot:

  1. install the right version of Postgres in the container by writing postgres:12, it always installs the 10th version ( I created a ticket )
  2. create required database schema and user and assign the last one to the scheme using the lando recipe configuration

@labboy0276
Copy link
Contributor

Let me check into postgres for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants