TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 10-05-2009, 01:08 PM   #1 (permalink)
The Contributor
 
pipesportugal's Avatar
 
Join Date: May 2008
Location: Oporto-Portugal
Posts: 32
Thanks: 11
pipesportugal is on a distinguished road
Default increasing session time

Hello dear colleagues from the TalkPHP forum,

Sometime ago the admin of my server has decreased the session time and now when I am using our reserved area the session extinguishes very fast.

Can please someone tell me how from inside my php program can I increase this time ?

Regards and thanks in advance,
pipesportugal is offline  
Reply With Quote
Old 10-05-2009, 01:27 PM   #2 (permalink)
The Wanderer
 
Join Date: Sep 2009
Posts: 9
Thanks: 1
afraca is on a distinguished road
Default

What do you mean with "from inside my php program" ? If you have direct access to the php config directory you should edit the php.ini file, look for the part with "session.gc_maxlifetime" and set it to how many seconds you want.

However, if I'm right, you're restricted, so you could do it in php with the ini_set function. use this:

PHP Code:
<?php
ini_set
(session.gc_maxlifetime28800);
// Set maxlifetime to 4 hours, overwriting php.ini’s value
?>
(session.gc_maxlifetime should have single quotes, but the forum is converting them...... (new at forum, howto fix that?)
afraca is offline  
Reply With Quote
Old 10-05-2009, 01:58 PM   #3 (permalink)
The Contributor
 
pipesportugal's Avatar
 
Join Date: May 2008
Location: Oporto-Portugal
Posts: 32
Thanks: 11
pipesportugal is on a distinguished road
Default

Hi,

In fact I do not have access to the php.ini file.

I should use the ini_set instruction just before the session_start(), right ?

Thanks in advance,
pipesportugal
pipesportugal is offline  
Reply With Quote
Old 10-05-2009, 02:10 PM   #4 (permalink)
Wizard
Top Contributor 
 
Village Idiot's Avatar
 
Join Date: Sep 2007
Posts: 1,299
Thanks: 17
Village Idiot is on a distinguished road
Default

Not all hosts will allow you to do this, shared servers aren't meant for any real customization.
__________________

Village Idiot is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Huge Session Problem Killswitch General 1 11-17-2008 02:36 AM
Understanding the Life of a Session Wildhoney General 6 10-27-2007 02:34 AM
Two Different Ways to Format the Time CMellor Tips & Tricks 0 09-24-2007 11:12 PM
Script Execution Time Class Wildhoney Script Giveaway 2 09-14-2007 11:36 PM
Calculating the Execution Time Wildhoney Tips & Tricks 0 09-14-2007 11:14 PM


All times are GMT. The time now is 11:16 PM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design