connection management WIFI remotely

Opening and closing WIFI remotely Why doesn't it always work? I have to go to the screen and log in again like the first time After I have already set everything up