
If you run account.get() in the device you're able to get it?

*pnb,it is empty in session tab in user though

Then there's not any active session

can you elaborate a little?

Seems that you are already logged out

Check if running account.get() it returns any value. If it throws an error that means the user has been successfully logged out

but i'm getting session response using this code```var awPhone = servRes['awphone']; Future result = account.createPhoneSession( userId: box.read('user_id_appwrite'), phone: awPhone, );
result.then((response) {
print('sessionId ->' + response.$id);
print('sessionExpire->' + response.expire);
box.write('sessionId', response.$id);
// showSuccess('Signup Complete', 'Account created successfully');
box.write('redirectIndex', true);
Get.offAllNamed(Routes.HOME);
}).catchError((error) {
print(error.response);
showError('Server Connection Failed',
'Please check your network connection and try again later');
});```

awphone is something like +123123123(real country code+phon no)

I/flutter (22032): sessionExpire->2023-06-16T10:59:09.868+00:00
I/flutter (22032): {message: User (role: guests) missing scope (account), code: 401, type: general_unauthorized_scope, version: 0.10.40}```This is when i do accout.get() ater creating phonesession

what's the differnce in account and user

Role guest, means you have a guest account (no logged in)

how to logged in tho?i have created user then i create session,did i miss any procedure?

When you create an user, you already get a session. When using account.get() it should give you a response with the email the account has, name, etc

If after running in your flutter app account.get() it throws you an error, that means the use is not logged in

then how to fix that?π₯Ίi mean how to log in?

account.createEmailSession()

Example in dart:
import 'package:appwrite/appwrite.dart';
void main() { // Init SDK
Client client = Client();
Account account = Account(client);
client
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
Future result = account.createEmailSession(
email: 'email@example.com',
password: 'password',
);
result
.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}

do i need create account with that user first to this(https://appwrite.io/docs/client/account?sdk=flutter-default#accountCreate) or just creating a user is enough (https://appwrite.io/docs/server/users?sdk=php-default#usersCreate)?

Thanks,i have created session successfully but when i delete the session using session ID, i got this error


ap.Account account = ap.Account(client);
Future result = account.deleteSession(
sessionId: box.read('sessionId'),
);
result.then((response) {
print('Session deleted!');
print(response);
}).catchError((error) {
print(error.response);
});
}```

Never mind,there was a typo in my code,creating session using email and delete like this works fine!!!

[SOLVED]Deleting session not working

Btw, this doesn't actually create a session because creating a phone session is a two step process.
See https://appwrite.io/docs/client/account?sdk=flutter-default#accountCreatePhoneSession
And for phone sessions, you don't need to create the account beforehand

oh i see,i have to confirm to session with that OTP, Thanks!<:appwritepeepo:902865250427215882>
Recommended threads
- Sites 30MB limit from GitHub
Iβm deploying a site from github as Other type on the Hobby plan. It is actually a Flutter web app but itβs in a subdirectory with the root being an html landin...
- Query params are way too limiting in ter...
I was trying to list rows in a table that do not already exist in another table. I retrieved around 260 row IDs which are 13 characters in length each, and then...
- [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...
