PDA

View Full Version : I need help in protection of webpages


Castleme2
03-27-2003, 01:38 AM
:confused: How do I stop someone from accessing a page on my site dirrectly by forcing them to use a link or load from another page.
example . John wants to enter secret page. so he types it in directly into his browser because he knows the name of the page. But instead of coming up with the page it comes up with another page that say you were lead to this page from the wrong place or such. I want that to happen on my website when people try to access my pages without going through the login page. :confused:

liorean
03-27-2003, 01:42 AM
This can be handled by referrer checking. If the Referer [sic] header contains the correct page, you give them one page, if it doesn't, you give them another. How you do this depends on whether you use Apache, IIS or some other server.

Roy Sinclair
03-27-2003, 02:58 PM
Unless your site reads serially (each page is linked to by one and only one page) you need to make sure that you only check the referring page up to the server level and not for the exact page.

Alternatively you can have your login page set a session cookie which the other pages can check for and redirect to the login page if it isn't present. That has the advantage of allowing the user to exit your site and then return later without having to worry and yet it will still go away when they close their browser.