473,770 Members | 2,082 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Session time out too fast

Hello,

I made a simple script with some session variables. When I work in the
application, and when I don't use the application for some time, the
session vars are erased... even when I set the session time out for 4
hours....

Here is a part of the code:

<?PHP
session_cache_e xpire(240);
$cache_expire = session_cache_e xpire();
session_start() ;
include('functi ons.php');
$naam_l = '';

if (isset($_SESSIO N['a_name'])) $naam_l = $_SESSION['a_name'];

How is it possible that the vars don't work anymore , for example
within 30 min?
Is there maybe a problem in IE6? How can I debug this problem....

Greetings and thanks,

Ronald,
Vlaardingen - The Netherlands

Jul 23 '07 #1
1 3096
Rik
On Mon, 23 Jul 2007 20:47:31 +0200, Rogier <r.************ @gmail.com
wrote:
Hello,

I made a simple script with some session variables. When I work in the
application, and when I don't use the application for some time, the
session vars are erased... even when I set the session time out for 4
hours....

Here is a part of the code:

<?PHP
session_cache_e xpire(240);
$cache_expire = session_cache_e xpire();
session_start() ;
include('functi ons.php');
$naam_l = '';
RTFM:
session.cache_e xpire integer
session.cache_e xpire specifies time-to-live for cached session pages in
minutes

session.gc_maxl ifetime integer
session.gc_maxl ifetime specifies the number of seconds after which data
will be seen as 'garbage' and cleaned up. Garbage collection occurs during
session start

The 'cache expire' is for:"cache control method to use for session pages
(none/nocache/private/private_no_expi re/public)", NOT for timing out
sessions.

So, set session.gc_maxl ifetime to an appropriate value.
--
Rik Wasmus
Jul 23 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

27
7128
by: mrbog | last post by:
Tell me if my assertion is wrong here: The only way to prevent session hijacking is to NEVER store authentication information (such as name/password) in the session. Well, to never authenticate a user from information you got from the session. Each secure app on a site must challenge the user for name and password, each and every time the user accesses it (not just once and then store it in the session). If a secure app is multi-page,...
11
3586
by: HolaGoogle | last post by:
hi all, can you please tell me what i should do to avoid session timeout when displaying my database info in my asp form (DisplayUserDatabase.asp)??? ** actualy it does load and display the database randomly....otherwise it's always runs into a session time out.... **Also when i save new account info (You'll notice that i've been asked to put a save button near each record...so, it's not one global save it's by record), i'd like to be...
5
2615
by: Mark Rodrigues | last post by:
Hi Everyone, I have been fighting a problem for a while and I wonder if someone out there can help. This problem has been presented in a number of news postings previously but I am yet to see a response with a suitable resolution. So here goes ... We have a web site which stores an instance of a class into a Session, which is used in a number of pages. The code looks something like:
1
2887
by: lsf_80 | last post by:
I am using Session to capture my login name and this session is checking on every page that required login. However, there is a problem that the session is expired too fast! When i jump to another windows, then go back to the page that i have developed, the user is required to login again even less than 5 minutes. Thus, how can i solve this problem? This is because i can't find any problem in my code and i don't know how could this...
6
2387
by: Gonenc Ercan | last post by:
Hi, I ve ended up debugging a ASP.NET project (with about 380 files on the project .NET Framework 1.0 on IIS 5.0) which has a memory leak... The memory rises too fast. With about 25-30 active sessions (average) the memory rises about 300 MB's in an hour. I've checked the database (SQL Server 2000) and seen that there are lots of sleeping connections. (about 400!!!) I thought somewhere in the code they left the connection open, so decided...
0
977
by: George | last post by:
Hi, I am working on a web site and have a problem with how Session is handled by ASP.NET. Let's say you have a successful web site and one day google (or yahoo) finds out about it. So it decided to spider it. So google's robot just came in and hit every page (within short period of time) on your website. For simplicity you have 1000 pages on your website and google's robot does not preserve cookies. So basically Google's bot just...
14
9328
by: Sergei Shelukhin | last post by:
Hi. I have a session started in php and two browser windows (IE)/tabs (FF) open. In one window, I execute a very slow report, immediately after that, I execute a fast simple page in another. I have set up a timer that records time into global variable at the start of the request, it outputs three time values in seconds - right before session_start, right after session_start, and at the very end of the request. here's what it shows
6
3782
by: ChrisAtWokingham | last post by:
I have been struggling with unexpected error messages on an ASP.NET system, using SQL and C#. The application draws organisation charts, based on data stored in the SQL database. Some of the chart editing processes place a very heavy load on the server as the effects of the edit ripple through the organisation structure, requiring potentially large numbers of rows in one of the tables to be updated. (I have done it this way to make the more...
0
9595
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
10232
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
10059
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...
1
10008
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
8891
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...
0
5313
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
5454
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3974
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2822
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.