Is it possible to set session expiration based on a specific time duration in PHP?
Yes, it is possible to set session expiration based on a specific time duration in PHP by setting the session cookie expiration time using the `session_set_cookie_params()` function. This function allows you to specify the lifetime of the session cookie, which in turn determines how long the session will last.
// Set session cookie expiration time to 1 hour
session_set_cookie_params(3600);
session_start();
Related questions
-
error suppression PHP @ symbol
-
dynamic HTML generation PHP concatenation
-
fwrite PHP functions