473,856 Members | 1,834 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 41997
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
43203
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
7442
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
2126
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
1625
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
15478
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
5504
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
9698
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
2779
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
4922
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
9465
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
9911
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9762
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
11055
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...
1
10780
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10383
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7932
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
7093
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
5761
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
5958
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.