homepage Welcome to WebmasterWorld Guest from 54.226.191.80
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Microsoft / Microsoft IIS Web Server and ASP.NET
Forum Library, Charter, Moderators: ocean10000

Microsoft IIS Web Server and ASP.NET Forum

    
Using User Agents to return to homepage
Andrew Thomas




msg:944959
 12:59 pm on Aug 18, 2004 (gmt 0)

Im after any thoughts on how to overcome the following:

A site requires an age verification from the homepage, If a user comes through to a page via a search engine and enters a page within the site, I need to see if this user has already visited the site and verified his age, if not to redirect back to the homepage.

I was intending on writing an asp script with USER AGENT in mind, any recommendations appreciated.

thanks

 

duckhunter




msg:944960
 1:15 pm on Aug 18, 2004 (gmt 0)

What about a cookie? If the UserAgent is in a list of known spiders, don't redirect or drop a cookie which would allow the SE's to spider your site without getting the redirect.

encyclo




msg:944961
 1:19 pm on Aug 18, 2004 (gmt 0)

Do you mean
HTTP_REFERER rather than the user agent? If so, don't forget that the referrer string can be unreliable at best, and there are many programs which strip out the referrer altogether, so you risk putting people into an infinite loop.

I agree with duckhunter, a session cookie would be better, but you'll have to make arrangements for the bots.

Andrew Thomas




msg:944962
 1:24 pm on Aug 18, 2004 (gmt 0)

Thanks, how would i go about coding this in ASP?

mattglet




msg:944963
 6:32 pm on Aug 18, 2004 (gmt 0)

Take a peek into the Response.Cookies [msdn.microsoft.com] collection.

dataguy




msg:944964
 6:36 pm on Aug 19, 2004 (gmt 0)

Why not set a session variable when a user hits the home page, and on interior pages is that veriable isn't set, then redirect them...

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Microsoft / Microsoft IIS Web Server and ASP.NET
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved