That is actually not a problem in Ubuntu, but a problem with the configuration in the cafe. Not all cafes offer free, one click away internet connection. Cafes and Airports for example offer a website to which you connect (Tipically a 192.168.1.1, 10.0.0.1 or similar IPs) and in the web page the charge you with some credit point or credit card the time or bandwidth you will be using. This is one case.
Other cases include a proxy setting that you need to do or some static ip that you need to configure.
In any or all cases you need to ask in the place where you want to connect. Either to the person attending the cafe or if in an airport to somebody in charge.
Mentioning that the wireless connection works in your home just shows that the wireless device in your laptop is working correctly. So the problem must be somewhere else and not in Ubuntu.