Questions tagged [koa-session]
10 questions
6
votes
2 answers
koa-passport logout() is not clearing session
I am using koa, koa-passport and koa-session to log users in which works fine but when I call ctx.logout() the user can refresh and still be logged in. It seems that ctx.session and/or the cookies are not being correctly cleared.
This still fails…

Jareth
- 431
- 1
- 3
- 16
5
votes
1 answer
Koa-session getting reset after appending object to it?
I have a controller which looks up a character, and then does some stuff with it, the controller looks like:
router.post('/profile/characters', async ctx => {
try {
ctx.type = 'json';
let req = ctx.request;
if…

Datsik
- 14,453
- 14
- 80
- 121
3
votes
1 answer
Enable User Session In Strapi
I want to enable session for every user who requests for the token using the URL "/auth/local" which is the default API provided by Strapi. I guess Strapi is by default configured with Koa session but inspite of that no session cookie is returned in…

Rishi
- 31
- 1
- 3
2
votes
1 answer
How to access a token in session (Shopify Access Token)
I mostly work on front-end so I'm not super familiar with NodeJS.
I'm working on a Shopify Custom App and purpose of this app is when order placed it will receive webhook request and with that request it will send some data to other API (billing…

Closery
- 828
- 9
- 14
2
votes
2 answers
How can I get session information from koa-session inside a socket.io instance?
How can I use session information from the module koa-session inside a socket.io instance e.g.
In my app.js
const sesh = session(app);
require('./sockets/socket')(app);
My sockets.js file
module.exports = async(session) => {
let app =…

Datsik
- 14,453
- 14
- 80
- 121
1
vote
0 answers
how to set and get session with koajs and koa-session?
im already read from the documentation and also find some tutorial like tutorialspoint. But, so far i dont know how to create and use session with koa. Here's my code:
router.post('/login', async ctx => {
const user = ctx.request.body
const name…

dhanyn10
- 704
- 1
- 9
- 26
1
vote
1 answer
koa session expire event
Am trying to log a message when a koa session expires. But adding a listener for the expire event doesnt seem to work for me.
Following is the sample code. Set 2 mins as maxAge for the session.
import koa from 'koa';
import serve from…

Rayees
- 108
- 8
0
votes
0 answers
Updating `userProperty` in koa-passport doesn't work
I can't for the life of me figure this one out :(
Problem
My app is a game, so the users are called players. In order to keep consistency across the app, I want to change the property name that koa-passport uses when it logs a user in. The default…

woollyblanket
- 1
- 2
0
votes
1 answer
Koa-session making new session per request?
I'm setting up a Vue app with Koa as the backend. I've implemented a simple login system, using koa-session for sessions. This is all fine when I access the server directly (actually navigating to my server port and performing a request), but when I…

Imperial Water
- 86
- 2
- 7
0
votes
1 answer
Koa ctx.session lost after redirect
I have two Node.js server apps. The first one runs Koa.JS on localhost:8081, while the second one runs Vue.JS on localhost:8080.In both servers, I am using HTTP not HTTPS.
The Koa.JS server uses Passport.JS to perform oAuth2 login flow, as well as…

B. Mazeran
- 33
- 1
- 5