HTTP Cookie Bug

  • james_97118-1316114828800037009

    0xJam3s

    5 months ago

    Hey guys, it seems my bearer token is saving but when I get the HTTP cookie it doesn't get pass the value to the my following api calls. It was working earlier. Any ideas, why this might be?
  • @NoCode ProCode I am uisng an edge function
  • erikbeus-1316115416086745088

    Erik Beuschau

    5 months ago

    If you set the cookie using the set session cookie action in toddle, the cookie will be a same site cookie. Therefore, you need to make sure you proxy your API request through toddle’s backend. Check under β€œadvanced” on your API call
  • james_97118-1316116220579282995

    0xJam3s

    5 months ago

    Thanks @Erik Beuschau - I do have the proxy setting enabled on the advanced tab
  • erikbeus-1316116561706352710

    Erik Beuschau

    5 months ago

    I see. It’s a bit tricky to debug without more details. Perhaps you could send me instructions on how to reproduce? If the project is public, you can just send me the link to your project 🀞
  • james_97118-1316118763904696362

    0xJam3s

    5 months ago

    I have sent you a link to the project in a DM mate, thanks! @Erik Beuschau
  • codenitrr-1316120236440944640

    codenitrr

    5 months ago

    I have also struggled with this several times. I was able to solve it by reinstalling the Toddle Chrome plugin. No idea if it helps with you too, but thought I'd mention it
    πŸ‘1
  • james_97118-1316121759350788096

    0xJam3s

    5 months ago

    Thanks @ - yesterday I did do that and it fixed my issue. Not this time though, and it's not working on the staging site either
  • lucasg-1316122656910741515

    Lucas G

    5 months ago

    The extension will only affect the editor having access to the cookie
  • The actual call should have it regardless as long as the proxy is turned on
  • james_97118-1316122937388040294

    0xJam3s

    5 months ago

    When I check network in log

    I see:

    authorization:
    Bearer {{ cookies.access_token }}
    content-type:
    application/json
    cookie:
    access_token=eyJhbGciOiJIUzI1NiIsImtpZCI6Ikd3cmhRV1ZMSitYWFZLNysiLCJ0eXAiOiJKV1QifQ.eyJpc3MiOiJodHRwczovL2FhaHRuZ29tb3BzZmFudHN4ZXR0


    Why does the cookie exist there? Surely it defeats the point i the {{ cookies.access_token }}?
  • lucasg-1316122943004344372

    Lucas G

    5 months ago

    Assuming the cookie was correctly set/is not expired
  • lucasg-1316122998935130164

    Lucas G

    5 months ago

    The network log will show the placeholder
  • james_97118-1316123065557586000

    0xJam3s

    5 months ago

    But it includes also

    cookie:
    access_token=eyJhbGciOiJIUzI1NiIsImtpZCI6Ikd3cmhRV1ZMSitYWFZLNysiLCJ0eXAiOiJKV1QifQ.eyJpc3MiOiJodHRwczovL2FhaHRuZ29tb3BzZmFudHN4ZXR0...
  • lucasg-1316123091750879263

    Lucas G

    5 months ago

    The call will have it correctly on the backend
  • james_97118-1316135949033537646

    0xJam3s

    5 months ago

    All sorted thanks to Eric. I was running GO TO URL at the same time as updating the access token. I should have been updating the access token on success of the event. Thanks guys
    πŸ™Œ3