# Calculate format=diff merge(x11-misc/lightdm)=>1.28
diff --git a/src/seat.c b/src/seat.c
index 8513418..65bf80d 100644
--- a/src/seat.c
+++ b/src/seat.c
@@ -759,6 +759,7 @@ session_stopped_cb (Session *session, Seat *seat)
 {
     SeatPrivate *priv = seat_get_instance_private (seat);
 
+    gboolean reactivate = FALSE;
     l_debug (seat, "Session stopped");
 
     g_signal_handlers_disconnect_matched (session, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, seat);
@@ -767,13 +768,16 @@ session_stopped_cb (Session *session, Seat *seat)
         g_clear_object (&priv->active_session);
     if (session == priv->next_session)
         g_clear_object (&priv->next_session);
-    if (session == priv->session_to_activate)
+    if (session == priv->session_to_activate) {
         g_clear_object (&priv->session_to_activate);
+        reactivate = TRUE;
+    }
 
     DisplayServer *display_server = session_get_display_server (session);
 
     /* Cleanup */
-    if (!IS_GREETER_SESSION (session))
+    // don't launch cleanup script for non-authenticated session and session reactivation
+    if (!IS_GREETER_SESSION (session) && session_get_is_authenticated(session) && reactivate == FALSE)
     {
         const gchar *script = seat_get_string_property (seat, "session-cleanup-script");
         if (script)
