The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
tar 2GB limit SLKRR Filesystems, Disks and Memory 9 12-04-2006 11:19 AM
Limit logins to 1 pheusion AIX 0 08-11-2006 08:23 AM
limit telnet shaikh.naveed SCO 5 08-10-2006 09:45 PM
sqlplus session being able to see unix variables session within a script 435 Gavea Shell Programming and Scripting 2 07-03-2006 07:11 AM
Limit command macdonto UNIX for Dummies Questions & Answers 1 10-21-2002 12:58 PM

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-20-2005
Registered User
 

Join Date: Oct 2004
Posts: 215
session limit in php

Sirs,
How can i set the session.gc_maxlifetime value by php coding.
Thanks
ArunKumar
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 01-25-2005
RTM's Avatar
RTM RTM is offline
Hog Hunter
 
Join Date: Apr 2002
Location: On my motorcycle
Posts: 3,039
Quote:
If you cannot edit your php.ini put this line at the top of all your
scripts:
ini_set('session.gc_maxlifetime', 7200);
Found at Sitelab101
Reply With Quote
  #3 (permalink)  
Old 01-25-2005
zazzybob's Avatar
Registered Geek
 

Join Date: Dec 2003
Location: Melbourne, Australia
Posts: 2,100
For info;

The php.net site (and various national mirrors) holds the definitive PHP reference documentation.

For example, http://uk2.php.net/manual/en/ref.session.php will give you all the information you need on configuring and handling sessions.

Cheers
ZB
Reply With Quote
  #4 (permalink)  
Old 02-04-2005
Registered User
 

Join Date: Feb 2005
Posts: 1
Question timed sessions

reading that documentation, i found things such as setting a cookie or cache lifetime, but i didn't see anything on setting a session lifetime. i need to expire a session after 5 minutes then redirect to a login page. could i set a cookie expiration and then just check if the cookie is set? i would perfer to do it with session variables. does anyone know how?
Reply With Quote
  #5 (permalink)  
Old 02-07-2005
Registered User
 

Join Date: Feb 2004
Posts: 91
Quote:
Originally Posted by kodemonki
reading that documentation, i found things such as setting a cookie or cache lifetime, but i didn't see anything on setting a session lifetime. i need to expire a session after 5 minutes then redirect to a login page. could i set a cookie expiration and then just check if the cookie is set? i would perfer to do it with session variables. does anyone know how?
Sessions are in fact just cookies that are stored on the server instead of the browser of the client viewing the page.

Adding ini_set('session.gc_maxlifetime', 7200); to the begining of a PHP script will set the session lifetime at the time the script is run (initialization set). You can also change this for the entire PHP server by editing the php.ini file on the servers end.

-Sys
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 08:45 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0