So just what glue do you use to glue the sole of your shoe back on when it is dangling down and you don't want to go to the shoe maker.
It must be strong, waterproof and flexible. Construction adhesives will not work, as they are generally ridged. Silicone caulking could work but there are glues that adhere better to both leather and rubber. There is actually one glue called "Shoe Glue", by Goop and very similar, and I suspect almost the same formulation is a marine glue, made to stand up to salt water. Both work very well for the task. But don't forget to scrape the surfaces clean first.
Glue-Shoe Gloo, Household Goop and Marine Goop are easily available in hardware stores.