A public computer could just be the place where a malware or keylogger is hiding. Using your passwords on a public computer is always fraught with risk. Facebook recognizes this ‘public menace’ and has a security feature that could be the safety net in a cybercafé, hotel, airports, or a library.
To make sure that computer you are using in a public place does not store your login information you can ask Facebook for a temporary password. The temporary password can be obtained by using your cell phone and sending a SMS.
Just type in a text message saying otp to 32665. You will receive a temporary password in return that will stay valid for 20 minutes. Use this to log in instead of your regular password. After that the password will be useless and no one else will be able to log in using that.