I have an index page that detects if users have JavaScript and cookies enabled before going to the Login page. The login page will only show the login form if both are enabled.
I first set a cookie on the index page. If the cookie is read on the Login page, then cookies are enabled. If JavaScript is disabled, it redirects to the login page with a querystring letting me know it failed.
My problem now is that the redirect in the keeps firing even when scripts are enabled. What do I need to change here?
<html>
<head>
<%
response.cookies("enabled")="1"
%>
<noscript>
<%response.redirect("http://www.test.com/test/login.asp?noscript=true&settingsCheck=1")%>
</noscript>
<%
response.redirect("http://www.test.com/test/login.asp?&settingsCheck=1")
%>
</head>
<body>
</body>
</html>
NOSCRIPTis a client tag.<% ... %>executes server-side. Thus, the code inside theNOSCRIPTtag is still evaluated on the server regardless of the surrounding markup.You could use a
METArefresh tag to accomplish the redirect on the client. This does not require script, so it could be placed within theNOSCRIPTtag. This is valid HTML 5 markup.