SvelteKit appears to call getSession() before endpoints and it should be calling them after.
Repro:
git clone https://github.com/coryvirok/svelte-getsession-order-bug.gitcd svelte-getsession-order-bug && npm inpm run devsrc/routes/index.jssrc/routes/foo.jsYou will see the following print out in your server-side console logs:
for GET /
handle() - 1st
getSession() - 3rd
GET / - 2nd
handle() - 4th
for GET /foo
handle() - 1st
GET / - 2nd
handle() - 4th