Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

some options don't work #149

Open
PoBiRi opened this issue Jan 2, 2024 · 2 comments
Open

some options don't work #149

PoBiRi opened this issue Jan 2, 2024 · 2 comments

Comments

@PoBiRi
Copy link

PoBiRi commented Jan 2, 2024

'clearExpired', 'checkExpirationInterval', 'expiration' options don't works in my code how can i fixed it?
it seems to need some privileges, what privileges need for these options?

const mysql = require('mysql');

const db = mysql.createConnection({
    host: 'localhost',
    user: 'host',
    password: '1234',
    database: 'pohub',
    port:'3306'
});

const sessionStore = new MySQLStore({
    clearExpired: true,
    checkExpirationInterval: 5000,
    expiration: 10000,
}, db);

app.use(
    session({
        httpOnly: true,
        secret: "hello",
        resave: false,
        saveUninitialized: false,
        store: sessionStore,
        cookie: {
            maxAge: 10000,
            sameSite: 'lax',
            /*secure: true,
            sameSite: 'none',*/
        }
    })
);
@chill117
Copy link
Owner

How do you know these options don't work? What have you tried? What have you observed? What errors, if any, do you see in your logs?

@PoBiRi
Copy link
Author

PoBiRi commented Jan 15, 2024

image
when make session with this user account,
data record doesn't disappear in my mysql database.
but with my root account, there is no problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants