Here's some background on the issue so you can understand it better. There are two issues that you face.
1.Query strings – dynamically generated URLs that contain ‘?’ and ‘amp;’ characters. These can be removed, or replaced, using ‘URL rewriting’ – a technique that involves a web-server plug-in (e.g. mod_rewrite for Apache or IIS_rewrite for IIS), and the conversion of these special characters to a ‘directory’ style URL (e.g. /news/document/latest.html).
This is probably what you have installed (rewrite_mod) to avoid the dynamic urls. It looks to me that this is working but when the spirder gets to your site and refuses the tracking cookie, the cookieless otpion in your app kicks in and the url becomes dynamic....read below to see why this happens.
2. Session IDs. Many sites use ‘sessions’ to allow the persistent tracking of a user throughout a site (so that the user remains logged-in, or for user-path analysis, etc.). To allow this ‘persistence’ across multiple pages of a site, the CMS will create a unique number (session id) for the user, and store it in a) a cookie, b) a per-session cookie, or c) the query string (URL) of each internal link. As many users/browsers will not allow cookies, a) and b) are often replaced by c) when the CMS cannot create a cookie for the user. The Google spider, amongst others, will not accept cookies, and the site may therefore include the session id in URLs for the Google spider. (This is happening to your site) As Google needs to uniquely identify each page (so that it doesn’t re-index the same page multiple times), this session id will present Google with different URLs for each visit (a new session is started on each visit), and as Google cannot obtain a single unique URL for each page, it won’t index the site. To prevent this, sessions (or at least URL based session ids) should be switched off for any search-engine-spider visits. Search engine spiders can be detected (and sessions switched off accordingly) by detecting the robot’s user_agent in the HTTP headers.
Detecting the spiders is easy.
This code will do it for aspz:
<%
Dim spidercheck
Spidercheck = Request.ServerVariables("HTTP_USER_AGENT")
If Spidercheck = "Googlebot" Then
Enablesessionstate=False
End IF
%>
Make sure your dveloper reads this article to make sure that no other calls are made to the session object once the spiders session is disabled.
http://support.microsoft.com/kb/306996/EN-US/#2
The resaon you can't see the session id in the url is because your browser is accepting cookies. If you turn off cookies the cookieless setting in you app will allow you to see the session id in the url in the address bar.
I can't determine why some urls are getting formatted with the session id and some without...I would need to see the actual aspx code to figure this one out....PM it to me if you want me to take a look.
There may also be an easier fix to this issue. I came across an article where a user claimed that their shopping cart software had a directives area where they could enter in user agents to automatically disable the session object.....they didn't mention what they were using but may be you cart app has a similar feature