session limit in php


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting session limit in php
# 1  
Old 01-21-2005
session limit in php

Sirs,
How can i set the session.gc_maxlifetime value by php coding.
Thanks
ArunKumar
# 2  
Old 01-25-2005
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
# 3  
Old 01-25-2005
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
# 4  
Old 02-04-2005
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?
# 5  
Old 02-07-2005
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
Login or Register to Ask a Question

Previous Thread | Next Thread

6 More Discussions You Might Find Interesting

1. Solaris

Limit: stacksize: Can't remove limit

Hi all, I'm using to Solaris machine. When I run a simple script this messenger come out:"limit: stacksize: Can't remove limit". Any one know the way to resolve this problem without reboot the machine? Thanks in advance. (3 Replies)
Discussion started by: Diabolist9
3 Replies

2. Shell Programming and Scripting

Memory limit on php in .sh script

Hi, I have .sh script running php script with "php". When I run php script from web browser, it is running without errors. When I run it from .sh script, I am getting "memory exhausted". It seems to me that running php from .sh does not respect php.ini or have its own setting. So, how can I set... (0 Replies)
Discussion started by: LukasB
0 Replies

3. Solaris

Difference between the desktop session and console session

what is the difference between desktop session and console session in solaris as i am wondering we use option -text for the former and -nowin for the later (1 Reply)
Discussion started by: kishanreddy
1 Replies

4. Solaris

I am not able to login in gnome session and java session in Sun solaris 9& 10

I am not able to login in gnome session and java session in Sun solaris 9& 10 respectively through xmanager as a nis user, I am able to login in common desktop , but gnome session its not allowing , when I have given login credentials, its coming back to login screen, what shoul I do to allow nis... (0 Replies)
Discussion started by: durgaprasadr13
0 Replies

5. Shell Programming and Scripting

Hiding Directories on a Session by Session basis

Hi, Apologies if anyone has read my recent post on the same subject in the Linux forum, just thought actually the solution might more likely come from scripting. Essentially, I am trying to restrict access to directories based on the user's name AND their location on a session-by-session... (3 Replies)
Discussion started by: en7smb
3 Replies

6. Shell Programming and Scripting

sqlplus session being able to see unix variables session within a script

Hi there. How do I make the DB connection see the parameter variables passed to the unix script ? The code snippet below isn't working properly. sqlplus << EOF user1@db1/pass1 BEGIN PACKAGE1.perform_updates($1,$2,$3); END; EOF Thanks in advance, Abrahao. (2 Replies)
Discussion started by: 435 Gavea
2 Replies
Login or Register to Ask a Question