I've seen lots of examples about how to detect if a PHP session is started. What I can't find is how to handle cookie params if one is started.
Here's my code. This is in a WordPress plugin. If another plugin starts the session, I get a warning about setting cookie params when this plugin runs. How do I correctly set these params if another plugin has already started a session without doing a session_destroy and goofing up the other plugin's session?
$session_length = (60 * 60) * 8; // 1 hour x 8 = 8 hours
session_set_cookie_params($session_length, "/", null, false, true);
session_start();
setcookie(session_name(), session_id(), time() + $session_length);