We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8b9bdec commit c41c8baCopy full SHA for c41c8ba
tawkto/tawkto.php
@@ -624,12 +624,17 @@ public function start_session() {
624
return;
625
}
626
627
- if ( ! is_user_logged_in() ) {
628
- return;
629
- }
630
-
631
if ( session_status() === PHP_SESSION_NONE ) {
632
session_start();
+
+ // If user is not logged in, remove the visitor session and close the session.
+ // Session cannot be updated if it is not started.
+ if ( ! is_user_logged_in() ) {
633
+ if ( isset( $_SESSION[ self::TAWK_VISITOR_SESSION ] ) ) {
634
+ unset( $_SESSION[ self::TAWK_VISITOR_SESSION ] );
635
+ }
636
+ session_write_close();
637
638
639
640
0 commit comments