for correct logout from the system you have to maintain service "logoff" (TC SICF sap/public/icf/logoff) - activate service.
next step go to service WEBGUI (sap/bc/gui/sap/its/webgui) open service webgui and go to tab "error pages" next go to subtab "logoff" select redirect to URL post url from "logoff" service (previous step) you can get url name by performing service test for "logoff" (TC SICF sap/public/icf/logoff) service.
Now you should be able to completely logout from the system.