473,413 Members | 1,778 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Session time out

Hi i am, developing a new project for a calling card company. I am, having problems in the session time out. I want to redirect a user to the login page when the session time out expires. All of the pages have session_start() in them to see if the user has actually logged in to the site. I set the session.cookie_lifetime on my login page to 60 seconds and when i click on some url after 60 seconds it takes me to the login page which is very much i want. but the problem is when i click a link before 60 seconds (say at 45 seconds) and then click on some other link and so on it never re-directs me to the login page. If i set the session.cookie_lifetime on every page then it works fine. If the total time for a session is 5 minutes then the above solution means 5 minutes for one page.. i am, confused and not getting a clue as to how to solve this problem. Is there any way the user can be redirected to the login page when the overall session time expires irrespective of the number of pages the user is visiting? is there any relationship between session_start() and the session.cookie_lifetime .. ?? please respond !!!
Regards.
Sep 21 '06 #1
1 5864
bevort
53
How do you set the livetime?

session_set_cookie_params ( int lifetime [, string path [, string domain [, bool secure [, bool httponly]]]] )

Normaly each time you "use" your browser to submit a link to another page this Session_lifetive starts over

If you want the complete session to be killed after say 10 minutes use
setcookie ( string name [, string value [, int expire [, string path [, string domain [, bool secure [, bool httponly]]]]]] )
and replace expire with your system-date plus the 10 minutes. Keep inmind that your date and time an not alwasy the users date and time. I did not test this effect on timing out a session
Sep 21 '06 #2

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

Similar topics

0
by: Thotatri | last post by:
hi, I am facing a session time out problem once after installing .net framework 1.1 . The problem is session is getting expired on frequently say 5 mts like that.I have good configuration &...
0
by: GP | last post by:
Session time out in IIS is set for 60 min,but why does we get "Object reference not set to an instance of an object. " when the browser is not used for more than 4 to 5 minutes.Please let me know...
1
by: Jeff | last post by:
Question. How would I go about increasing the session time of a user, before they are logged out for inactivity? The reason I want to do this, is because players may have the site open, while...
1
by: abcd | last post by:
I am using classic ASP. When the session times out theglobal.asa event called session_on end is invoked which is absolutely correct. When I explicitely do IIS reset or iis restart then again...
4
by: shahnawaz shaikh | last post by:
i want to know can we give page level session time out on page just like we give session time out in web.config.
0
by: arjun kamlakar | last post by:
Hi All, I am arjun kamlakar working as programer in hochtechnologies. I got a problem with session time out. I have used <httpRuntime executionTimeout= "9000"> <Session Timeout=...
1
by: Rogier | last post by:
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...
2
by: ShirishKumar | last post by:
hi, I have one task, i want to show some information on my web page "Your Session has completed please login again",when the Session time out. thanks, Shirish.
3
by: kolhapur | last post by:
hello, i want to change session time.the session time should differ according to section of my module. i have tried with these function ini_set('session.gc_maxlifetime'), ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
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...
0
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,...
0
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...
0
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...
0
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,...
0
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...
0
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...

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.