Potential bug in this code: I'm pretty sure the cookies set in `setcookie()` aren't available in `$_COOKIE` until the next page load. Multiple calls to `get_session()` on the user's first page load will return different session IDs.

One possible solution is to assign `$_COOKIE[ $this->id_base ][ $this->options()->session_cookie->name ] = $session` in the `else` condition so that subsequent calls will use the first condition of the `if`.