What are some potential pitfalls of extending session lifetime at runtime in PHP?

Extending session lifetime at runtime in PHP can potentially lead to increased server resource usage and security risks, as it keeps the session active for a longer period of time. To mitigate these pitfalls, it is recommended to carefully consider the necessity of extending session lifetime and implement proper session management practices.

// Set session lifetime to 30 minutes
ini_set('session.gc_maxlifetime', 1800);
session_start();