Actually, your code is sort of pointless, because of the way sessions are done in PHP. There is a setting which determines the probability of a "garbage collection" happening, and this probability will influence how often old session files get deleted. You can of course set this value to 1, meaning that every time someone loads a page, garbage collection will run, but this put a rather nasty overhead on your page.
If you want to do "number of current users on this page/site" (again, rather pointless), then search old articles in this forum, people have solved this hundreds of times before, no need to reinvent the wheel.