Page 1 of 1

question on session

Posted: Sat Aug 14, 2010 12:23 am
by waichun89
Hi guyz, hope you can help me on this matter..
Let say i got a php file that will run huge codes with long processes, and it requires more than 30 minutes to finished it.
My codes are divided to 2 parts, where first part require 25 minutes, and second part require 5 minutes. Each of them requires "admin" session to pass the if statement.

Here's the sketch of my codes:
<?
if(isset($_SESSION['admin'])){
//this part require 25 minutes
}

if(isset($_SESSION['admin'])){
//this part require 5 minutes
}
?>
so while processing my first part of code, will my session destroyed due to inactivity for 20 minutes? will my second part of code runs?
if my session will be destroyed, is there any solution to this?
(except putting 2nd part of code into first part)

Re: question on session

Posted: Sat Aug 14, 2010 2:30 am
by arrielmabale
set this

set_time_limit(0);

then set session to 0 to make it unlimited lifespan

session_set_cookie_params('0');

Re: question on session

Posted: Sat Aug 14, 2010 12:43 pm
by shawngoldw
I'm just curious, what are you doing that takes half an hour to run?