jayeshOriginal post
Web Developer
Hello, While attempting to log in to the account, I encountered an error in the sign-in function: '[AppwriteException: Creation of a session is prohibited when a session is active].' I double-checked that the user successfully signed up or registered in the database, but when I tried to log in, that error occurred. What could be a potential issue?
export async function signIn(email, password) {
console.log(email, password);
try {
const session = await account.createEmailPasswordSession(email, password);
console.log(session);
return session;
} catch (error) {
console.log(error);
throw new Error(error);
}
}
Summary
Issue: Developers encountered an error '[AppwriteException: Creation of a session is prohibited when a session is active]' while trying to log in.
Solution: Check for any existing active sessions before creating a new one to resolve the error.