The only way to actually find out whether a cookie has been successfully set is by checking for the cookie upon the next request to the server. However, with JavaScript, this can be done instantly within one page. The following code first sets two cookies (a temporary one and a persistent one) and then checks whether these two actions were successful. Also, the test cookies are deleted againbut of course only if setting them has been successful. Checking the Browser's Cookie Support (checkcookie.html)
|