๐ Bug Report: Session is not persistent
Closed this issue ยท 4 comments
๐ Reproduction steps
Login the user and try to print logged in user it shows Guest user
๐ Expected behavior
whenever user login it should show the logged in user
๐ Actual Behavior
Its not storing sessions even if the user is logged in it works like no one has logged in
๐ฒ Appwrite version
Version 0.10.x
๐ป Operating system
Linux
๐งฑ Your Environment
No response
๐ Have you spent some time to check if this issue has been raised before?
- I checked and didn't find similar issue
๐ข Have you read the Code of Conduct?
- I have read the Code of Conduct
@SmitProgrammer, thanks for raising this issue! ๐๐ผ Can you provide more details on your steps to reproduce this such as a code snippet?
In general, you would need to use the SSR approach since the Python SDK is a server SDK.
Yeah i know that its a server side sdk but since many people need client side sdk so it would be better if we do like passing a boolean variable that denotes that user wants to create session or not then it may work with both cases.
Code to reproduce:
from appwrite.client import Client
from appwrite.services.account import Account
client = Client()
(client
.set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint
.set_project('5df5acd0d48c2') # Your project ID
)
auth = Account(client)
auth.create_email_password_session(email, password)
print(auth.get()) # returns Guest user
I don't think we'll go down that route as we want to keep the Python SDK as a server SDK.
Using python client-side may be challenging as there is no standard way to store the session cookie.
no what i meant is it is after running create_email_password_session the expected behavior is that we can run auth.get() and it should return the logged in user but it says "Guest User" instead of the original logged in user.
so what i meant for persistent session is once the user is logged in then it should keep it until the code is running.