How much later in the program? After subsequent page loads? If so, then the most common means is to save them in the server-side session. How you do that depends on how you are powering your backend code. Servlets? PHP? Something else?
If you need to save it on the client side, then cookies is the most common way. If you have the luxury of only supporting the latest browsers, there's also HTML5 local storage.