Ok . i will follow my other thread http://forum.mikrotik.com/t/php-api-connection/33417/1 here because this board is more popular .

I have also test with mikrotik official python api client . it has same problem and does not clear the admin from “/user active print” .
even after sending /quit . with /quit it successfully closes the connection and raises “connection closed by remote end” but the admin is still remains alive at “/user active print” .
The problem is not just the growing number of active sessions . the main problem is cannot get challenge after some hours and then unable to connect to API