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:
// 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?)