views:

299

answers:

2

For a c# web site project that serves content for mobile phones i need to use sesion state. Mobile browsing is abit tricky area, you cannot rely on cookies because some networks just removes them or some phones does not support them at all.

.net's cookieless sessions perfect solution for me but they come with some cons. For example app in the start of session .net redirects user current page itself with AspxAutoDetectCookieSuppor=1 parameter in order to check if cookies supported.

This is not ideal for me as every request will get redirected atleast once and search engines does not like this.

My question is if there is any way setting up session state mode in global.asax or with http handler when a session started so i can control it's mode and set false for search engine bots

A: 

You could try to detect the browser agent (as each Search Engine bot has it's own agent version's this could prove difficult) and use a BasePage class for all your pages, setting the EnableSessionState to false if the browser agent is a search engine.

Colin
although it stops creation of sesison on page, it does not stop redirection with parameter AspxAutoDetectCookieSupport=1
nLL
A: 

As Jeff has talked about in his podcasts, you could set up a dedicated server for search engines and route their traffic to it. That way it can be configured correctly for Google/etc.., and be configured differently for everyone else.

I know it's not the easiest solution from a management standpoint, but it's an option.

Aaron Daniels