You would need to login after the "who > .f" finishes and before the "who > .s" starts for this script to behave the way you want. That is a very short period of time. Putting a lengthy sleep between them will increase the chance that it can catch some logins, but you will not catch them all with this technique.
You need to rewrite the script to eliminate the race condition.
#!/bin/bash
who > .s
while [true]
do
who > .f
diff .f .s > .t1
if [-s .t1 ]
then
echo "In System stranger"
break
else
continue
fi
who > .s
diff .f .s > .t
if [ -s .t ]
then
echo "In System Stranger"
break
else
continue
fi
done