for that you can write like that
Configure::write('Session.timeout', '120');
Configure::write('Security.level', 'medium');
if 'high' then Session timeout in 'Session.timeout' x 10,
if 'medium' then Session timeout in 'Session.timeout' x 100,
if 'low' Session timeout in 'Session.timeout' x 300