Hi ALL,
I have uplaoded my application to server which is working fine on local PC.
Client complained of session time out and while I checked I found that session time out is set in session.gc_maxlifetime varaible in php.ini
Values that was set was 1440 which is in seconds so it means 24 min. I asked the hosting company to increase it but they said as we are on sahred hosting so they will not changs rather we should place our copy on server there and change it. I did the same thing and change the session.gc_maxlifetime to 3600 sec.
But still it logs out before 3600 sec I can't tell exactly when but if I don't perform any activity on stiefor let say 30 min it logs out but if I do soem things after 20 min it still keeps the session. Which makes me think that session value is still set to 24 min raher then 60 min that I have set.
Please advise if I am right and does our local ini is not taking in to the effect. But checking php.ini and wrting this code in our application ini_get("session.gc_maxlifetime") gives us 3600 sec.
pre-thaks
Atiq
Session time out before session.gc_maxlifetime value
Moderator: General Moderators
- stereofrog
- Forum Contributor
- Posts: 386
- Joined: Mon Dec 04, 2006 6:10 am
What does this print?
Code: Select all
print_r(ini_get_all('session'));This is what that code prints:
Code: Select all
Array
(
[session.auto_start] => Array
(
[global_value] => 0
[local_value] => 0
[access] => 7
)
[session.bug_compat_42] => Array
(
[global_value] => 0
[local_value] => 0
[access] => 7
)
[session.bug_compat_warn] => Array
(
[global_value] => 1
[local_value] => 1
[access] => 7
)
[session.cache_expire] => Array
(
[global_value] => 180
[local_value] => 180
[access] => 7
)
[session.cache_limiter] => Array
(
[global_value] => nocache
[local_value] => nocache
[access] => 7
)
[session.cookie_domain] => Array
(
[global_value] =>
[local_value] =>
[access] => 7
)
[session.cookie_lifetime] => Array
(
[global_value] => 0
[local_value] => 0
[access] => 7
)
[session.cookie_path] => Array
(
[global_value] => /
[local_value] => /
[access] => 7
)
[session.cookie_secure] => Array
(
[global_value] =>
[local_value] =>
[access] => 7
)
[session.entropy_file] => Array
(
[global_value] =>
[local_value] =>
[access] => 7
)
[session.entropy_length] => Array
(
[global_value] => 0
[local_value] => 0
[access] => 7
)
[session.gc_divisor] => Array
(
[global_value] => 1000
[local_value] => 1000
[access] => 7
)
[session.gc_maxlifetime] => Array
(
[global_value] => 3600
[local_value] => 3600
[access] => 7
)
[session.gc_probability] => Array
(
[global_value] => 1
[local_value] => 1
[access] => 7
)
[session.name] => Array
(
[global_value] => PHPSESSID
[local_value] => PHPSESSID
[access] => 7
)
[session.referer_check] => Array
(
[global_value] =>
[local_value] =>
[access] => 7
)
[session.save_handler] => Array
(
[global_value] => files
[local_value] => files
[access] => 7
)
[session.save_path] => Array
(
[global_value] => /data/tmp
[local_value] => /data/tmp
[access] => 7
)
[session.serialize_handler] => Array
(
[global_value] => php
[local_value] => php
[access] => 7
)
[session.use_cookies] => Array
(
[global_value] => 1
[local_value] => 1
[access] => 7
)
[session.use_only_cookies] => Array
(
[global_value] => 0
[local_value] => 0
[access] => 7
)
[session.use_trans_sid] => Array
(
[global_value] => 0
[local_value] => 0
[access] => 6
)
)- Buddha443556
- Forum Regular
- Posts: 873
- Joined: Fri Mar 19, 2004 1:51 pm
I am not able set that path right now.... I have cheked with hosting company but they are very slow in responding... I will check when ever they get back to me... but is there any other soluion to this problem.. as session is still timing out aftr 24 min. I also tried to maualy set the time out through ini_set() but no success...
- Buddha443556
- Forum Regular
- Posts: 873
- Joined: Fri Mar 19, 2004 1:51 pm
Only other way I can think of is to use database sessions. Tutorial for database sessions [I've only skimmed that article I'm not recommending it, it's just an example].Atiq wrote:I am not able set that path right now.... I have checked with hosting company but they are very slow in responding... I will check when ever they get back to me... but is there any other soluion to this problem.. as session is still timing out after 24 min. I also tried to maualy set the time out through ini_set() but no success...
There's also a command session_save_path() for setting and getting that path ... though session.save_path is PHP_INI_ALL.