
this is my login action
TypeScript
export async function signInUser(
data: LoginSchema
): Promise<ActionResult<string>> {
try {
const { email, password } = data
const { account } = await createAdminClient();
const session = await account.createEmailPasswordSession(email, password);
cookies().set("appwrite-session", session.secret, {
path: "/",
httpOnly: false,
sameSite: "strict",
secure: false,
});
return { status: 'success', data: 'Logged in' }
} catch (error) {
console.log(error);
return { status: 'error', error: 'Something else went wrong' }
}
}
Get user login session
TypeScript
export async function getLoggedInUser() {
try {
const { account } = await createSessionClient();
return await account.get();
} catch (error) {
return null;
}
}
See session in appwrite console
also see cookie but no data
TL;DR
Developers are trying to implement server-side rendering (SSR) authentication in NextJS using the "node-appwrite" library. They are facing issues with the login session and retrieving the logged-in user. The login action successfully sets the session cookie but is unable to retrieve the user session and data. They can see the session in Appwrite console but not in the cookie.
Solution:
Developers can check the session creation and retrieval logic to ensure the proper handling of sessions and cookies. They may need to troubleshoot the session creation steps to ensure the session data is being properly stored and retrieved. Additionally, verifying the session handling settings such as

console.log on login

"node-appwrite": "^12.1.0-rc.4"
Recommended threads
- Subdomain failed verification
So I wanted to do a custom subdomain, because local storage doesn't work for me, but I've tried it a long time ago, it didn't work for me, and now I'm trying ag...
- 404 error when navigating to the team fr...
the version i m running is `1.7.4` as far as i can tell everything is working fine except for this weird bug in the video. when monitoring the appwrite and app...
- [Node.js SDK] Bypass 2GB file limit?
Hello. Using either InputFile.fromPath or InputFile.fromBuffer throws this error: File size (2295467305) is greater than 2 GiB Bucket limit etc. is setup corre...
