I have a question regarding PHP sessions. I've been working on a website where I need to set a session variable to expire after 30 minutes of inactivity. However, I'm not quite sure how to achieve this.
To give you some context, I have a feature on my website that requires users to log in. Once they are logged in, I store certain user-specific data in session variables. This allows me to provide a personalized experience to each user.
Now, what I want to do is automatically log out users if they have been inactive for 30 minutes. I believe setting an expiration time for the session variable should do the trick. However, I'm not sure about the exact steps to accomplish this in PHP.
Could someone please guide me on how to set a session variable to expire after 30 minutes of inactivity? I would greatly appreciate any help or suggestions.
Thank you in advance!