Hi,
I'm attempting to limit access to a page without creating a whole load of session values and there for re-writing the page. So I've come up with the following code on a test page[CODE=asp]<%@ Language=VBScri pt %>
<%Option Explicit%>
<%
IF session("Userid ")<>request.Que rystring("Stu") and session("Userid 2")<>request.Qu erystring("Stu" ) Then
response.redire ct "../../login/errors/notloggedin.asp "
End if
%>
[/CODE]
This in theory should prevent the user from editing the url themselves as if their session value doesn't match the value in the url it should re-direct them to an error. For some reason it's not working though even though that's literally all the code there is on the page.
If I get it to print out the session userid and the url stu value they are the same yet it still redirects me to the error page. What am I missing?
I'm attempting to limit access to a page without creating a whole load of session values and there for re-writing the page. So I've come up with the following code on a test page[CODE=asp]<%@ Language=VBScri pt %>
<%Option Explicit%>
<%
IF session("Userid ")<>request.Que rystring("Stu") and session("Userid 2")<>request.Qu erystring("Stu" ) Then
response.redire ct "../../login/errors/notloggedin.asp "
End if
%>
[/CODE]
This in theory should prevent the user from editing the url themselves as if their session value doesn't match the value in the url it should re-direct them to an error. For some reason it's not working though even though that's literally all the code there is on the page.
If I get it to print out the session userid and the url stu value they are the same yet it still redirects me to the error page. What am I missing?
Comment