472,353 Members | 1,897 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,353 software developers and data experts.

how to set session timeout in php.ini file?

127 100+
in php.ini file...
Expand|Select|Wrap|Line Numbers
  1. session.gc_maxlifetime = 1440
  2.  
if i change the value it doesnt work... i set the
Expand|Select|Wrap|Line Numbers
  1. session.gc_maxlifetime = 3600
  2.  
but it doesnt work...
how to set session timeout to one hour?
plz help...
Nov 15 '10 #1
6 41469
Shenno
59
// php.ini setting required for session timeout.

ini_set(‘session.gc_maxlifetime’,60*60);
ini_set(‘session.gc_probability’,1);
ini_set(‘session.gc_divisor’,1);


u can use ini_get function to see if your changes has been saved.

hope this helps.
Nov 15 '10 #2
Shenno
59
// php.ini setting required for session timeout.

ini_set(‘session.gc_maxlifetime’,60*60);
ini_set(‘session.gc_probability’,1);
ini_set(‘session.gc_divisor’,1);


u can use ini_get function to see if your changes has been saved.

hope this helps.
Nov 15 '10 #3
impin
127 100+
where i put this in my php code or in php.ini file?
Nov 16 '10 #4
Shenno
59
if u have access to php.ini file, search the for

session.gc_maxlifetime
session.gc_probability
session.gc_divisor


and set there values as mentioned in the functions

other thing i've remembered may be the line are comments. remove # before the line
Nov 16 '10 #5
i want to set session time out 5 mint....
how to change
ini_set(‘session.gc_maxlifetime’,60*60);
ini_set(‘session.gc_probability’,1);
ini_set(‘session.gc_divisor’,1);

according to my need
Jun 6 '16 #6
ini_set(‘session.gc_maxlifetime’,60*5);
for 5 minutes.

value is in seconds. you can also give like this,
ini_set(‘session.gc_maxlifetime’,300);

Note: Restart Apache once done the modification. Then only it will reflect.
Dec 29 '17 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

12
by: Geigho | last post by:
Setting session timeout in web.config file does not seem to have any effect. Any explanation or suggestion will be appreciated.
4
by: Nedu N | last post by:
how to make session not to time out (infinite life time)? if not possible how to increase the time out? for my application its timing out fairly...
3
by: Jim Heavey | last post by:
I am wanting to find out a way to timeout my session This issue is that the user retrieve data from a datatable and that data get stale over time,...
0
by: LearninGuru | last post by:
Hi Folks, I am creating a web service that will be hosted on a web farm. The web service also uses sessions to store user specific data. I have...
4
by: DavidS | last post by:
First: There are several ways to confuse one regarding session timeout. (1) web.config - <sessionState timeout="20"> (2) IIS Manager | Internet...
8
by: bdeviled | last post by:
I am deploying to a web environment that uses load balancing and to insure that sessions persist across servers, the environment uses SQL to manage...
2
by: Rajesh.jain25 | last post by:
Hi, I am facing a problem of automatic session timeout problem and automatic session_end event fired. Case1: As I have analyzed I get to know...
4
by: Vanessa | last post by:
hi everyone, I changed the login session timeout from default 20 to 30 minutes, like following: Session.Timeout = 30 But it doesn't work. I...
2
by: Aryan | last post by:
Hi, I have put my session related parameter in web.config under system.web, given below is the code for same. <system.web> <sessionState...
4
by: UJ | last post by:
I have a page where the user can upload a video file. As you can guess, this may take a while. Is there a way I can change the session timeout for...
1
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...
0
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.