As others have mentioned, use a 2 part glue that comes in 2 tubes and doesn't set until they are mixed.
Important to check that the particular type is suitable for the application, but araldite 2-part epoxy resin is suitable for many things. its a bit thick and gloopy though and you need to mix in on some kind of pallet, I generally use a a torn off piece of carrier bag or some other disposable plastic platform, it's a bit more faff, but then you don't have the issue of a useless tube of super glue that set solid after the first use, you can use it over and over.
It costs about a £5-£10 but I've been using the same 2 part glue pack for a few years for most random household occurrences that require a glue repair.
On a similar note, thought I should mention it even though its quite a specialist glue, 'ZAP CA-thin' is pretty brutal stuff, its super glue but thinner than water and sets almost immediately, as it acts much like water before it sets, it drains into the tiniest cracks and crevices, is used to seal tiny cracks in wood etc., for real detail repairs.