What it returns right now it's not really undefined but a promise.
Because it is an async function, you need to await:
const session = await getUserSession("abc123");
console.log(session); // → "{"userId":123,...}"
If you can't await:
getUserSession("abc123").then(session => { console.log(session); })