Skip to content
This repository has been archived by the owner on May 24, 2022. It is now read-only.

Session timeout on login. Unexpected behavior. #97

Open
Ovsyanka opened this issue Dec 1, 2014 · 5 comments
Open

Session timeout on login. Unexpected behavior. #97

Ovsyanka opened this issue Dec 1, 2014 · 5 comments

Comments

@Ovsyanka
Copy link

Ovsyanka commented Dec 1, 2014

I plan to fix it by myself, so i interested in your requests.

Session timeout don't working as expected.
When you do this:
setcookie(session_name(), session_id(), time() + $timeout);
you change lifetime of cookie in browser, but not change lifetime of session files on server.
And when time come - session files become deleted and session become ended regardless of cookie lifetime.

I think, that adding session lifetime in config is a good idea.
It will be same for all users.
It is possible set personal settings of session lifetime for each user in config, but i don't think that it is needful.

Another setting i want to add is session files store path.
Here explanation of problem that could be fixed by this setting (see note one).
http://php.net/manual/en/session.configuration.php#ini.session.gc-maxlifetime

Ovsyanka added a commit to Ovsyanka/rockmongo that referenced this issue Jan 25, 2015
Now session timeout worked =)
And it is described in config file and no possibility to set it for each user differently.
Furthermore added setting of session store path.
Ovsyanka pushed a commit to Ovsyanka/rockmongo that referenced this issue Feb 10, 2015
fixed unexisted session direcrory behavior.
Ovsyanka added a commit to Ovsyanka/rockmongo that referenced this issue Dec 11, 2015
Now session timeout worked =)
And it is described in config file and no possibility to set it for each user differently.
Furthermore added setting of session store path.
Ovsyanka added a commit to Ovsyanka/rockmongo that referenced this issue Dec 11, 2015
Now session timeout worked =)
And it is described in config file and no possibility to set it for each user differently.
Furthermore added setting of session store path.
Ovsyanka added a commit to Ovsyanka/rockmongo that referenced this issue Dec 11, 2015
Now session timeout worked =)
And it is described in config file and no possibility to set it for each user differently.
Furthermore added setting of session store path.
@saurabheights
Copy link

Hi,
Is there any update on this issue?

@Ovsyanka
Copy link
Author

Ovsyanka commented Aug 7, 2016

Hi, you can get my pull-request #102, that fixing it.

@saurabheights
Copy link

Cool, thank you.

@stefanocudini
Copy link

Vote on this issue please #133

@morebrackets
Copy link

morebrackets commented Dec 1, 2020

change session_start at the top of app/classes/BaseController.php

session_start([ 'cookie_lifetime' => 172800 ]);

172800 is two-days

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

No branches or pull requests

4 participants