comparing the session to oitself is not correct.
if you compare the session to itself, that will always return true.
think of it this way:
if the session is cleared, it's value is set to ""
using:
if($_SESSION['mid'] == $_SESSION['mid'])
in this case basically means:
if("" == "")
that is always going to return true.
in the rule, set the criteria to Not Equal (!=)
and leave the compare to option blank. this will use the following condition:
if($_SESSION['mid'] != "")
if the user is logged in, the session will not equal "" and the rule will pass
if the user is logged out, it will equal "" and the rule will fail