PDA

View Full Version : Source Security


slyfox2099
12-09-2002, 07:19 PM
Hello,
Does anyone know how to secure the path of a page/directory? I am trying to build a site that will utilize memberships to intellectual content and don't want the users to bookmark the url to the page.

Thanks,

slyfox2099

angiras
12-09-2002, 08:24 PM
i fyou use asp net as platform it is very easy with the file web.config to secure a folder

slyfox2099
12-09-2002, 08:48 PM
just using the old asp for the time being. Any other suggestions?

oracleguy
12-10-2002, 12:51 AM
Here is a quick and easy way to prevent people from bookmarking the page.

On your main page or whatever page has a link to the "protected" page.


<a href="inside.asp?s=<%=Request.ServerVariables("HTTP_COOKIE")%>">Load next page</a>


Then on the "protected" page:


<%
dim s
s=request.querystring("s")
If s=Request.ServerVariables("HTTP_COOKIE") then%>

<p>Page content</p>


<% Else %>

<p>I'm sorry, it seems you have directly accessed this page. Please enter via our main page.</p>

<% End If %>


See how that works. Be advised that the HTTP cookie seems only to change with a new browser window.

whammy
12-10-2002, 04:32 AM
Hi Shawn! Welcome to the forums. :D

You trying to do this without cookies/sessions? You could use a database hit with associated "allowedcontents" fields/categories joined on another table i.e. with "memberID" once someone logs in to see if they have access to the page, if they haven't logged in or try to access content they're not allowed to view (directly or with a bookmark, if you do want to use a cookie) it will kick 'em to the login, or give them an "access denied" page, etc....

Just an idea, don't know the specifics of the app offhand.

I am planning something like that for the next iteration of the intranet app I manage as "the company" wants particular clients to have access to some areas of the site I would prefer they didn't right now, since it wasn't designed for that to begin with... :rolleyes: