I wrote a code, something type:
[[!+modx.user.id:ismember=`Mygroup_1`:then=`1`:else=`2`]]
and in other place:
[[!+modx.user.id:ismember=`Mygroup_2`:then=`3`:else=`4`]]
Earlier everything worked perfectly, then was updated to version 2.5.0, and recently to 2.5.2 I noted that if the user isn't authorized, then in option of a code No.2 it is removed 4, and in option of a code No.1 1 is brought. Though, the unauthorized user shan't belong neither to Mygroup_1, nor to Mygroup_2. How it "made the way" in group 1 and how from there to move away him?
Are you testing in another browser where you're not logged into the Manager? If you're testing in another browser tab while logged into the Manager, MODX can get confused about who you are.
What does this give you?
<p>UserId: [[!+modx.user.id]]</p>
I couldn't really follow your original post. What is the output of these two lines for the (anonymous) user?
[[!+modx.user.id:ismember=`Mygroup_1`:then=`1`:else=`2`]]
[[!+modx.user.id:ismember=`Mygroup_2`:then=`3`:else=`4`]]
I should have thought of this sooner.
The
Personalize snippet (author: me

) with the &allowedGroups property should do exactly what you want *much* faster than an output filter.
Are you sure that the (anonymous) user is not a member of Mygroup_1 and that Mygroup_1 is spelled correctly in the tag?
Did you try the Personalize snippet?