if your code uses cookie but the user's browser disabled cookie, will there be any problem?
of course. your cookies wont be set
Can session do everything that cookie can? Is session a better way than cookie and is replacing the idea of cookie?
Of course not. Sessions in PHP allows for one to preserve selected data accross accesses.
This can be done by sending the session id in some way, perhaps by query string.
One can use cookies to store the session id so that even without the query string, the session is saved.
if there are hundreds of users logged into my website at the same time, will the "$_SESSION['username']" be able to identify who is who?
whether or not cookies, sessions or both are used, you need a unique identifer to know who is who.
can username along provide that?
Yes, if only unique usernames are allowed.
It would be more reliable to use some other variable, such as a user id.