473,595 Members | 2,442 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to set session timeout in php.ini file?

127 New Member
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 41945
Shenno
59 New Member
// php.ini setting required for session timeout.

ini_set(‘sessio n.gc_maxlifetim e’,60*60);
ini_set(‘sessio n.gc_probabilit y’,1);
ini_set(‘sessio n.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 New Member
// php.ini setting required for session timeout.

ini_set(‘sessio n.gc_maxlifetim e’,60*60);
ini_set(‘sessio n.gc_probabilit y’,1);
ini_set(‘sessio n.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 New Member
where i put this in my php code or in php.ini file?
Nov 16 '10 #4
Shenno
59 New Member
if u have access to php.ini file, search the for

session.gc_maxl ifetime
session.gc_prob ability
session.gc_divi sor


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
Msohail
1 New Member
i want to set session time out 5 mint....
how to change
ini_set(‘sessio n.gc_maxlifetim e’,60*60);
ini_set(‘sessio n.gc_probabilit y’,1);
ini_set(‘sessio n.gc_divisor’,1 );

according to my need
Jun 6 '16 #6
praveenvt
1 New Member
ini_set(‘sessio n.gc_maxlifetim e’,60*5);
for 5 minutes.

value is in seconds. you can also give like this,
ini_set(‘sessio n.gc_maxlifetim e’,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
43178
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
7395
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 very quick even though i have time out = 99999
3
2111
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, so after 20 minutes, I want to be able to tell the user that their session has timed out and they will need to refresh their data I set the session time out in the web config file to 20 minutes, but this does not seems to have no effect. The user is still able to retrieve data and leave that data...
0
1601
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 the following doubts about session timeout in a web farm scenario: 1. In a web farm essentially the web service application will be hosted on multiple servers running IIS (any request being routed to one of the servers in the farm depending on various parameters). The session timeout value can...
4
15457
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 Information Services | ServerNode | Default Web Site | Properties | Configuration | Options | Enable Session State Session timeout 20 (3) within Global.asax.vb file - Session_Start subroutine can use Session.Timeout=x minutes or (4) within any web page, i.e., <web page>.aspx can use...
8
5479
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 sessions. The machine.config file determines how all applications will use sessions and to insure that all application use this method, the session properties cannot be overriden. Within the sessionstate tags, the webadmin (upon my request)r emoved the property for timeout, hoping that...
2
9677
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 that the default session timeout is 20 in web.config, If I reassign the session timeout at login page other than the time which is defined at web.config(20 Min.) then automatic session_end (in global.aspx.cs) event fired. Why automatic this event is fired??
4
2770
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 logged into my webpage, let it be inactived for 25 mins, and clicked on some links but the session expires already. Any one has cues? I put this line on the check login file after checking submitted username and password and before defining all session variables.
2
4897
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 timeout ="1440" mode ="InProc" /> </system.web> this session timeout is not working out, as this shows me login page again if i dont do something for more then 20 minutes.
4
9429
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 just this one page? I would also want to change the forms authentication to be a large value for that page also. TIA - Jeff.
0
7883
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8261
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8379
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
6674
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
5839
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5418
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3873
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
3911
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1490
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.