Skip to content

Cookies: can't read for SPA #17804

@drev74

Description

@drev74

What happened?

Hello ! I'm trying to access a cookie from the SPA mode without a success 🙄 .

I followed your docs and have the following code:

const $q = useQuasar()

const allCookies = $q.cookies.getAll()
const cookie = $q.cookies.get(sessionCookie)

console.log(`*** session cookie is set: ${JSON.stringify(allCookies)}`)
console.log(`*** cookie: ${cookie}`)

Is there anything I'm doing wrong with this ? 🤔

Quasar -

Image

What did you expect to happen?

Cookies can be accessed

Reproduction URL

http://0.0.0.0:9000

How to reproduce?

  1. Setup a basic SPA app
  2. Set Cookies with the backend
  3. Try to access cookies from a Vue component

Flavour

Quasar CLI with Vite (@quasar/cli | @quasar/app-vite)

Areas

Quasar CLI Commands/Configuration (@quasar/cli | @quasar/app-webpack | @quasar/app-vite), Components (quasar)

Platforms/Browsers

Chrome

Quasar info output

Operating System        Linux(6.8.0-52-generic) - linux/x64
NodeJs                  22.9.0

Global packages    
  NPM                   11.0.0
  yarn                  Not installed
  pnpm                  9.15.4
  bun                   Not installed
  @quasar/cli           2.4.1
  @quasar/icongenie     Not installed
  cordova               Not installed

Networking         
  Host                  lap
  wlp0s20f3             192.168.0.12
  br-770db3a45ab6       172.18.0.1

Relevant log output

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions