Re: how to prevent session creation for search engines
Brock Allen <[email protected]>
| Newsgroups | gmane.comp.windows.devel.dotnet.web |
|---|---|
| Message-ID | <000001c71c90$cb8703c0$62950b40$@com> |
If you're using ASP.NET 2.0 you can implement something called a SessionIDManager. This is a class you derive from that is responsible for generating the SessionID for requests. For your situation you would generate an empty ID when you detect the client is a bot/search engine. This prevents the request from utilizing session state. -Brock > -----Original Message----- > From: Discussion of building .NET applications targeted for the Web > [mailto:[email protected]] On Behalf Of Adam Tuliper > Sent: Friday, December 08, 2006 1:39 PM > To: [email protected] > Subject: Re: [DOTNET-WEB] how to prevent session creation for search > engines > > Off the top of my head.. prob use an httpmodule and make sure it's in > the > asp.net processing pipeline before the provider so you can handle it > ahead > of time. > Unless any of the interfaces for the provider give you that > functionality. > > > > -----Original Message----- > From: Discussion of building .NET applications targeted for the Web > [mailto:[email protected]] On Behalf Of Ryan Heath > Sent: Friday, December 08, 2006 10:12 AM > To: [email protected] > Subject: Re: [DOTNET-WEB] how to prevent session creation for search > engines > > The main problem is, we are using the built in session provider which > stores its sessions into a database. > > I don't want to 'block' the search engines, but I don't want to create > a session record for each page request they are doing. > > I believe I could use Request.Browser.Crawler to determine if the > request is done by a search engine. But I fail to see how to inform > the session provider to not create any session for that particular > request. > > Thanks, > // Ryan > > On 12/8/06, Adam Tuliper <[email protected]> wrote: > > Check user agent string - there are defined user agents for most > search > > agents > > See http://www.useragentstring.com/ > > http://www.pgts.com.au/pgtsj/pgtsj0208q.html (many others out there > as > well) > > This is also a trick that can be used to view content you don't have > a > > session for.. > > Ie change your user agent string in firefox (ie doesn't allow you - > only > to > > append to it unless you are using an http debugging proxy) and then > view a > > previously indexed but protected page.. > > So be sure to handle that technique as well. > > > > -----Original Message----- > > From: Discussion of building .NET applications targeted for the Web > > [mailto:[email protected]] On Behalf Of Ryan Heath > > Sent: Friday, December 08, 2006 2:31 AM > > To: [email protected] > > Subject: [DOTNET-WEB] how to prevent session creation for search > engines > > > > Hi, > > > > Does anyone know how we can prevent session creations for search > > engines on an asp.net 2.0 website? > > We use cookie based session, which obviously fails for search engines > ... > > > > Thanks, > > // Ryan > > > > =================================== > > This list is hosted by DevelopMentorR http://www.develop.com > > > > View archives and manage your subscription(s) at > http://discuss.develop.com > > > > =================================== > > This list is hosted by DevelopMentor(r) http://www.develop.com > > > > View archives and manage your subscription(s) at > http://discuss.develop.com > > > > =================================== > This list is hosted by DevelopMentorR http://www.develop.com > > View archives and manage your subscription(s) at > http://discuss.develop.com > > =================================== > This list is hosted by DevelopMentor. http://www.develop.com > > View archives and manage your subscription(s) at > http://discuss.develop.com =================================== This list is hosted by DevelopMentor® http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com