Js-cookie: Cookie not setting on Microsoft Edge

Created on 29 Jul 2020  路  4Comments  路  Source: js-cookie/js-cookie

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

bug

Most helpful comment

The value given for path is wrong. If you want to have a cookie available on every path, omit it altogether; if you want particular paths, provide a valid path; if you want the current page only, provide undefined.

All 4 comments

Could you please provide more information? For instance, what does the code look like, the OS, what version of Edge? The current amount of information won鈥檛 help is in identifying the problem.

// //save token
db.collection('session-cookie').doc(session_id).set({
transaction_token
})

      //save token
      Cookies.set('cleavepay_check_id', session_id, { path: '*' });
      // sessionStorage.setItem('Cleavepay_id', transaction_token);

     //get cookie
      let cookie = Cookies.get('cleavepay_check_id');

      // set state if cookie exist
      if (cookie){
        setUser(cookie)
        setLoading(false)

}

On Edge on聽Windows 10 | 84.0.522.48

The value given for path is wrong. If you want to have a cookie available on every path, omit it altogether; if you want particular paths, provide a valid path; if you want the current page only, provide undefined.

The value given for path is wrong. If you want to have a cookie available on every path, omit it altogether; if you want particular paths, provide a _valid_ path; if you want the current page only, provide undefined.

Thank you so much, it worked

Was this page helpful?
0 / 5 - 0 ratings

Related issues

BonBonSlick picture BonBonSlick  路  9Comments

DeadcatDev picture DeadcatDev  路  3Comments

navin11 picture navin11  路  4Comments

Daijobou picture Daijobou  路  6Comments

jiangdefu picture jiangdefu  路  3Comments