Are there any potential pitfalls to be aware of when setting a time limit for PHP sessions?

One potential pitfall when setting a time limit for PHP sessions is that if the time limit is too short, users may be logged out unexpectedly. To avoid this, it's important to strike a balance between security and user experience when setting the session time limit. One solution is to set the session time limit to a reasonable duration, such as 30 minutes to an hour, to balance security and usability.

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