This is a really deprecated approach, but if you really don't want to rely on the 30x behavior of the set-cookie browser, you can use HTML meta http-equiv="refresh" "redirect" when setting the cookie. For example, in PHP:
<?php ... setcookie("cookie", "value", ...); url="page.php"; ?> <html> <head><meta http-equiv="refresh" content=1;url="<?=$url?>"></head> <body><a href="<?=$url?>">Continue...</a></body> </html>
The server will send a Set-Cookie with 200 instead of the correct 300x redirect, so the browser will save the cookie and then perform a “redirect”. The <a> link is redundant if the browser does not perform a meta update.
MestreLion Jul 30 '19 at 15:26 2019-07-30 15:26
source share