Using (koa-)session


I want to use session in my project.

In the docs it states:

„The session middleware allows the use of cookie-based sessions, based on [koa-session] “ which seems to be the „strapi::session“ part in middlewares.js, which is all set.

So I am doing the following, which might be totally wrong or might miss something:

I am doing a user query first to fetch some labels based on language:

module.exports = createCoreController(‘api::label.label’, ({ strapi }) => ({

async find(ctx) {
const { lang } = ctx.request.query;
ctx.session.lang = lang;

In a second query, I am trying to pick up that value again.

module.exports = {
async setUpBase(ctx, next) {
const lang = ctx.session.lang

But this is undefined.

What am I doing wrong?

Thank you so much for any help!