question on session

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
waichun89
Forum Newbie
Posts: 3
Joined: Sat Aug 14, 2010 12:11 am

question on session

Post 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)
User avatar
arrielmabale
Forum Newbie
Posts: 15
Joined: Fri Aug 13, 2010 3:57 pm
Location: Dubai

Re: question on session

Post by arrielmabale »

set this

set_time_limit(0);

then set session to 0 to make it unlimited lifespan

session_set_cookie_params('0');
shawngoldw
Forum Contributor
Posts: 212
Joined: Mon Apr 05, 2010 3:38 pm

Re: question on session

Post by shawngoldw »

I'm just curious, what are you doing that takes half an hour to run?
Post Reply