Suppose a person have some bitcoins in his online wallet and he forget the password (or lose access to that online wallet in any way) then what will happen to that bitcoins?Will that be there forever or as the wallet providers have access to them and they will get them if they find no any owner for years.
If with online you mean hosted by a company u can always get it back.
If it's a wallet where you control the keys, such as jaxx then it's gone
Correct, you could retrieve your lost password by contacting the Support of that certain wallet, and then they will suggest to you to retrieve your password by using the email that you have provided when you created your online wallet, and if you can't remember any details about your private info when you have created that online wallet, sadly, that bitcoin stored in your wallet will remain there, unless someone would hacked it up.
So, in order to not to lose your password, it would be better if you are going to save it in your PC or in your smartphones, you could print it also in white paper, but the risk of losing it is big than saving it on the PC or smartphone.