question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Renewing the session

See original GitHub issue

How are we suppose to renew the session?

Using req.sessionOptions.maxAge = req.session.maxAge within a middle-ware?

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:17 (15 by maintainers)

github_iconTop GitHub Comments

3reactions
alvarotrigocommented, Oct 16, 2015

Sometimes I wonder how is it possible these modules get downloaded 70K times a month and their documentation and support is so limited.

I might be used to other platforms where things are different… but Node never stops surprising me.

2reactions
alvarotrigocommented, Oct 21, 2015

Did you provide any options at your middleware construction time?

I did as far as I know:

app.use(cookieSession({
  maxAge: 3 * 1000, //20*60*1000, //20 mins
  httpOnly: true,
  secure: true,
  secureProxy: true,
  keys: ['key1', 'key2']
}));

app.use(function(req,res,next ){
    console.log(req.session.user);  //user data
    console.log(req.sessionOptions); //empty array

    req.sessionOptions.maxAge: 4000;
    console.log(req.sessionOptions); //  (maxAge: 4000)

   return next();
});

I managed to solve the problem with the renew of the session thanks to this answer in stackoverflow.

Although I’m not quite sure yet why updating a fake session has anything to do with the renew of session.user maxAge.

Read more comments on GitHub >

github_iconTop Results From Across the Web

The Renewal Session- Spiritual Growth, Identity in Christ ...
In this podcast you will find, spiritual gifts coaching, purpose framework work, relationship discernment, mindset and heart work transformation, christian ...
Read more >
How to renew the session without quiting the browser - MSDN
On button1 click event, starting a session. On button2 click event clearing session. On button3 click event, checking session for null and renewing...
Read more >
The Renewal Session (@therenewalsession) • Instagram ...
The Renewal Session. Reclaim your purpose, Redefine your relationships, Renew your mind. therenewalsession.com. Quotes's profile picture. Quotes.
Read more >
3 ways to automatically renew a user session per token (JWT)
3 ways to automatically renew a user's session. 1st: Do not let the session token expire. A well-implemented token authentication ...
Read more >
renewal session Definition | Law Insider
Define renewal session. means the session at which national delegations as a whole are renewed when the 4-5 year mandate of the previous...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found