Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Session in ASP

Status
Not open for further replies.

whizzz

Programmer
Oct 19, 2003
32
IN
hi,
I am entry level programmer in ASP where I dont have much knowledge in ASP session handling.One of my project requires to put some session level checks on the result displaying pages to ensure results are displayed only if the parent page is hit.Clearly, the people should not be allowed to go the result page by entering the result page URL directly on IE,without navigating from the parent page.

Waiting to hear u...
Thanks in advance
 
Hi

You want to do something like this:

ParentPage |

Code:
<% Session("Valid") = 1 %>

Results Page
Code:
<% 
if Session("Valid") <> 1 then
Response.redirect("parentpage.asp")
else
end if
%>

I think thats what your looking for.

Thanks



Glen
Conception | Execution
 
If your result page is expecting submissions from a form, you could also try placing this at the top of your results page:

<%
if request.servervariables("REQUEST_METHOD")<>"POST" then _
response.end
%>

This way, if a user tries to enter your results page trying to bypass the form, it won't work. You can also response.redirect to another page instead of response.end
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top