You could try this module: Cookies Module It has not been updated for some time, so may not work with Mendix 9.
1. You can use custom javascript to achieve the result.
2. If you want to store information locally you may also check out Local storage possibility. Its easy to use and you don't need custom configuration.