Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

Session Variables going blank

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

Session Variables going blank

Postby superman21 » Tue Jun 10, 2003 1:03 am

Hello,
After I THINK 24 minutes or so of inactivity on a php script of mine the session variables that were set with data go empty. Now i did some research and i think i know what to fix, problem is its not working. "session.gc_maxlifetime" is set to 1440 seconds (24 minutes) and i used ini_set() to change it, it does change because I run a phpinfo() and it says the new setting, problem is even when I set it to something outrageous like 6 hours it still goes blank in 24 minutes. Anyone have any advice? Btw i am calling the ini_set before session_start(). I dont know whats wrong.
superman21
New php-forum User
New php-forum User
 
Posts: 5
Joined: Tue Jun 10, 2003 12:43 am

Postby liquedus » Tue Jun 10, 2003 4:08 am

set

session.gc_maxlifetime = whatever

in your php.ini file
liquedus
php-forum Active User
php-forum Active User
 
Posts: 266
Joined: Tue Apr 08, 2003 5:18 am
Location: Ottawa, Canada

Postby Redcircle » Tue Jun 10, 2003 4:12 am

have you tried changing the session.cookie_lifetime?
User avatar
Redcircle
Moderator
Moderator
 
Posts: 830
Joined: Tue Jan 21, 2003 10:42 pm
Location: Michigan USA

Postby superman21 » Tue Jun 10, 2003 6:36 pm

I have no control over the php ini file, I don't have admin access its on a shared server.

No I have not but that variable is set to save everything until the browser is closed, but I will try that.
superman21
New php-forum User
New php-forum User
 
Posts: 5
Joined: Tue Jun 10, 2003 12:43 am

Postby Redcircle » Tue Jun 10, 2003 10:12 pm

you can use ini_set() to change that variable. as the docs say it may not work on all systems.. but it's worth a try.
User avatar
Redcircle
Moderator
Moderator
 
Posts: 830
Joined: Tue Jan 21, 2003 10:42 pm
Location: Michigan USA

Postby superman21 » Wed Jun 11, 2003 4:51 pm

Again if you read my first post I am using ini_set() since I don't have direct access to the php.ini file. It is actually changing the values since I am checking via phpinfo(), but they are still going blank.
superman21
New php-forum User
New php-forum User
 
Posts: 5
Joined: Tue Jun 10, 2003 12:43 am

Postby Redcircle » Wed Jun 11, 2003 8:11 pm

ini_set() will need to be called on everypage that you want to change the variable. It is not a perm setting change so when you view phpinfo() it will display the default values that are in the php.ini
User avatar
Redcircle
Moderator
Moderator
 
Posts: 830
Joined: Tue Jan 21, 2003 10:42 pm
Location: Michigan USA

Postby WiZARD » Wed Jun 11, 2003 11:23 pm

i'm agree with admin! cause if each may give more time for session life, some hakers may use it......
security my friend..... :wink:
for what you want to extend timelife of session?
User avatar
WiZARD
Moderator
Moderator
 
Posts: 1257
Joined: Thu Jun 20, 2002 10:14 pm
Location: Ukraine, Crimea, Simferopol

Postby superman21 » Sat Jun 14, 2003 4:27 pm

Well I dont need it to last too long, perhaps 1 hour, currently its 24 minutes and thats a little too short.
superman21
New php-forum User
New php-forum User
 
Posts: 5
Joined: Tue Jun 10, 2003 12:43 am


Return to PHP coding => General

Who is online

Users browsing this forum: Google Feedfetcher, Majestic-12 [Bot] and 2 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.