Upon a user's initial visit to a specific page, I am displaying a jQuery overlay.
The overlay includes a radio button that users can click to indicate they do not want to see the notification again.
I am interested in setting a cookie to track users who opt out of seeing the overlay.
Is it feasible to set the cookie without reloading the page?
I considered making an AJAX call to the server and setting the cookie in the response headers, but I am unsure if the cookie will be properly set during an AJAX request/response.
Is it secure/acceptable to set the cookie solely through JavaScript? Or is this not recommended?
Are there any other alternatives I should consider?