Yung_Misanthrope
Yung_Misanthrope
HHono
Created by Yung_Misanthrope on 12/3/2024 in #help
Cookie not being set/created?
I understand. Thanks a lot for your help.
64 replies
HHono
Created by Yung_Misanthrope on 12/3/2024 in #help
Cookie not being set/created?
Didn’t seem so intuitive.
64 replies
HHono
Created by Yung_Misanthrope on 12/3/2024 in #help
Cookie not being set/created?
I see, thanks a lot for your help. How did you debug it?
64 replies
HHono
Created by Yung_Misanthrope on 12/3/2024 in #help
Cookie not being set/created?
Nice, how was it supposed to be done?
64 replies
HHono
Created by Yung_Misanthrope on 12/3/2024 in #help
Cookie not being set/created?
I’m not home unfortunately, it’s odd you’re getting this issue since I haven’t gotten this error.
64 replies
HHono
Created by Yung_Misanthrope on 12/3/2024 in #help
Cookie not being set/created?
You are right, I made a mistake, so the session, which is represented as an object had a property “secret”, session.secret is used when creating the cookie but session.secret would be empty when api key isn’t public.
64 replies
HHono
Created by Yung_Misanthrope on 12/3/2024 in #help
Cookie not being set/created?
So I did the following. I used the suggested values when setting cookie while also letting the api key be public. The session secret was created but despite being logged in I would be redirected to the login page. I then renamed the api key variable to NEXT_APPWRITE_KEY, the session secret was created but would still be redirected. Eventually I narrowed the issue being related to the “secret” property when a session is created. The session.secret would be empty when the api key isn’t visible. So the question that needs to be answered is how to pass the api key to the session without making it public.
64 replies
HHono
Created by Yung_Misanthrope on 12/3/2024 in #help
Cookie not being set/created?
I’m using nextjs so both. I’m using localhost at the moment. I will try your first solution though.
64 replies
HHono
Created by Yung_Misanthrope on 12/3/2024 in #help
Cookie not being set/created?
I tried chatgpt but didn't get any good answers except console logging.
64 replies
HHono
Created by Yung_Misanthrope on 12/3/2024 in #help
Cookie not being set/created?
I get an unauthorized error, which is 401 if I recall
64 replies
HHono
Created by Yung_Misanthrope on 12/3/2024 in #help
Cookie not being set/created?
so I do manage to login but when I try to visit a page that is only accesible to logged in users I am redirect to the login page.
64 replies
HHono
Created by Yung_Misanthrope on 12/3/2024 in #help
Cookie not being set/created?
So you know when you inspect in google chrome, you go to the application tab, and on your left you have cookies, and it shows you, a row with Name, Values, Domain etc.. In the Value column, it is empty.
64 replies
HHono
Created by Yung_Misanthrope on 12/3/2024 in #help
Cookie not being set/created?
yeah, it was spelled correctly.
64 replies
HHono
Created by Yung_Misanthrope on 12/3/2024 in #help
Cookie not being set/created?
Yes, I did exactly that and it was fixed.
64 replies
HHono
Created by Yung_Misanthrope on 12/3/2024 in #help
Cookie not being set/created?
Hi, thanks for trying to help, basically when I try to set cookie using the hono library, the cookie value would be empty when looking into the browser. I managed to fix it by making the appwrite API key public in the env.local file but i’m not sure that is the best way to proceed.
64 replies