Skip to content

GitLab Pages CORS error after cookie(600) expire

Summary

Hi,When I deployed the pages feature on gitlab, it worked fine, but when I clicked the button again on the current page 10 minutes later, occur an error (CORE erro) appeared. Similarly, I switched to a self-managed gitlab instance and found that the cookie parameter was not valid by modifying it. Is there any other way to solve this cookie expiration problem? I am looking forward to your reply very much. The following screenshot shows an error: image image And then when I hit F5, the problem doesn't appear。 image

Source of code:https://gitlab.com/adamibs/docsify-preview-example # https://adambenshmuel.medium.com/deploy-docsify-js-using-gitlab-pages-and-a-preview-environment-415de74592fd my code address: https://gitlab.com/ops888/pages.git

.gitlab-ci.yml configuration:

stages:
  - test
  - deploy

pages:
  image:
    name: cirocosta/alpine-envsubst:latest
    entrypoint: [""]
  variables:
    DOCSIFY_BASE_PATH: https://ops888.gitlab.io/pages/docs
    docsify: $docsify
  stage: deploy
  script:
    - mkdir .public
    - mv index.html .index.html
    - envsubst < ".index.html" > "index.html"
    - rm -f .index.html
    - cp -r * .public
    - mv .public public
    - ls
  artifacts:
    paths:
      - public
  only:
    - main

"Create Preview Environment":
  extends: pages
  variables:
    DOCSIFY_BASE_PATH: https://ops888.gitlab.io/-/pages/-/jobs/$CI_JOB_ID/artifacts/public/docs
  script:
    - mkdir .public
    - envsubst < "index.html" > ".index.html"
    - envsubst < ".index.html" > "index.html"
    - rm -f .index.html
    - cp -r * .public
    - mv .public public
  stage: test
  only:
    - main

Expectations

What are we expecting to happen?

What might happen if this goes wrong?

Rollout Steps

Rollback Considerations/Events