September 14, 2017 at 6:41 am #8517
Since an update a couple versions back, I’ve noticed that IN keeps logging me out every single time I close the window. Nothing’s changed as far as cookie settings in my browser, and it used to only do that every few hours.
I think I remember seeing a post somewhere about an .env setting to change when it logs you out, but for the life of me I can’t find it.September 14, 2017 at 6:49 am #8518
Try changing this value to true:
We’ll look into making this an .env setting.September 14, 2017 at 7:04 am #8519
That did the trick. Looks like one of the updates set it to true instead of false, so it was automatically expiring every time the window closed.
Sidenote: Could have sworn I saw someone mention an .env variable somewhere. But I’ve been wrong before, lol.September 14, 2017 at 7:08 am #8520
You probably saw these mentioned but they’re slightly different:March 6, 2019 at 12:50 am #19851
How work the
'lifetime' => env('SESSION_LIFETIME', (60 * 8)),variable ?
Does it mean 8 hours ? 🤔
I’d like to set my timeout to 3-4 hours…
Also When I edit an invoice does it have some autosave feature ? 🤔
I ask this because sometime I edit an invoice and the phone ring and I go out of my house and comeback few hours later so if I’m logged out and I did not save my invoice I would lose all my edit being logged out.
Regards ! ☺️March 6, 2019 at 1:52 am #19853
Not sure if they use that particular variable anymore unless
SESSION_EXPIRE_ON_CLOSEis set to
It’s handled in the .env file with
AUTO_LOGOUT_SECONDS(I have mine set to 3600, or one hour), and I think there’s also a
REMEMBER_MEsetting that can be put to
trueif you want it to keep you logged in indefinitely.
As for an autosave, I don’t think they have one. Best practice might be to just click “save draft” if you get pulled away in the middle of creating an invoice.March 6, 2019 at 7:03 pm #19897
Thanks for your reply,
I’m a little bit confused, what I would like to do is to have my session open indefinitely until I close my tab/windows with Invoice Ninja ? Does it is possible to do ? 🤔
Regards ☺️March 7, 2019 at 6:15 am #19909
Maybe this will help…March 7, 2019 at 3:56 pm #19938
Thanks for your reply,
I see “By default the app clears the session when the browser is closed”
Does there is an option to do the same thing when we close a tab with Invoice Ninja ?March 8, 2019 at 6:20 am #19945
You may be able to make it work by changing the settings in config/session.phpMarch 8, 2019 at 7:13 am #19947
Found a relevant answer here.
“Browsers only destroy session cookies when the entire browser process is exited. There is no reliable method to determine if/when a user has closed a tab. There is an
onbeforeunloadhandler you can attach to, and hopefully manage to make an ajax call to the server to say the tab’s closing, but it’s not reliable.
And what if the user has two or more tables open on your site? If they close one tab, the other one would effectively be logged out, even though the user fully intended to keep on using your site.”
So long story short, having the session end when you close the tab instead of the entire browser is likely not possible in any reliable fashion.
You must be logged in to reply to this topic.