Skip to content
Back

Oauth Google Missing cookie

  • 0
  • Self Hosted
  • Auth
  • Web
Karl
2 Feb, 2025, 11:25

Im using this following code to trigger oauth google to work

const handleGoogleLogin = () => { console.log(window.location.href); account.createOAuth2Session( OAuthProvider.Google, // provider window.location.href, // redirect here on success 'http://localhost:3000/oauth-fehler' // redirect here on failure ); };

But it doesnt save a valid session in my browser, neither a cookie nor fallback cookie in localstorage. Is that to be expected when working with localhost in dev environment? The session in appwrite exists and the user gets created as well.

TL;DR
Issue: Oauth Google not saving cookies in the browser when triggered using the provided code on localhost dev environment. Solution: The behavior of not saving cookies on localhost is expected in the development environment. You can try testing the Oauth functionality on a live server to verify the cookie-saving mechanism. Session creation in Appwrite and user creation are working fine.
Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more