This.res.cookie Error

Today I’m getting this error randomly, trying now several hours to find the problem but it keeps happening sometimes. It crashes my app so it’s critical. Can anyone help?

It often happens when using something with socket.

TypeError: this.res.cookie is not a function
    at App.setCookie (/opt/node_app/lib/core/app.js:105:22)
    at DatabaseProvider.login (/opt/node_app/lib/auth/provider.js:60:26)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async DatabaseProvider.autoLogin (/opt/node_app/lib/auth/provider.js:38:23)
    at async App.setAuthProvider (/opt/node_app/lib/core/app.js:181:33)
    at async App.getAuthProvider (/opt/node_app/lib/core/app.js:197:20)
    at async App.restrict (/opt/node_app/lib/modules/auth.js:48:26)
    at async App._exec (/opt/node_app/lib/core/app.js:481:30)
    at async App._exec (/opt/node_app/lib/core/app.js:452:17)
    at async App.exec (/opt/node_app/lib/core/app.js:421:9)
Community Page
Last updated: