php_value session.cache_expire 300
php_value session.cookie_lifetime 0
php_value session.gc_maxlifetime 300
If there were some boolean setting you wanted to reference, you would use "php_flag" instead of "php_value":
php_flag session.use_only_cookies on