How to get session user email id in python

Hi, i want to get the session user email id in python when i tried frappe.session.user it gives “Administrator” in the bench console…but when i tried the frappe.session.user in the browser console(js) it gives the correct logged in user.

can some help me in this.

frappe.session.user is correct

2 Likes

yes, but when i tried in the console it gives Administrator.!

1 Like

Create a whitelisted function and return frappe.session.user

It sets the user as per the incoming http request. In case of python console you’ll always get administrator

Thank you @revant_one ,I will try that and Thank you @mohitchechani :smile: