user3442435
user3442435

Reputation:

ASP.NET adds an extra info at the end of the URL. How to avoid it?

In an ASP.net website, the link to

http://scarab.ineo.be/Catalog.aspx?id_rayon=0000000015 

is redirected automatically to

http://scarab.ineo.be/Catalog.aspx?id_rayon=0000000015#.Uyr5GPnWWi0. 

Why is #.Uyr5GPnWWi0 added ?

I thought it was something regarding the sessionState. In the web.config, the sessionsState is

<sessionState mode="SQLServer" sqlConnectionString="data source=....\SQL2008R2; integrated security=false; user id=sa; password=...." />

Is it possible to avoid this extra info at the end of the URL ?

Upvotes: 1

Views: 783

Answers (2)

Phill
Phill

Reputation: 18794

That looks nothing like a sessionState issue, it looks EXACTLY like the AddThis plugin hash for tracking...

http://support.addthis.com/customer/portal/questions/352733-how-to-remove-hash-from-url-

If you're using AddThis it will add a hash to all links. You can turn this off by adding the following JavaScript:

<script type="text/javascript">
var addthis_config = addthis_config||{};
addthis_config.data_track_addressbar = false;
</script>

Edit:

I just took a look at your website, and you are using AddThis. You also have the following code in your page:

<script type="text/javascript">    var addthis_config = { "data_track_addressbar": true };</script>
<script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-510a8b7d07484835"></script>

Notice how you have the config for addressBar tracking set to true.

You need to turn this off.

Upvotes: 3

JP Hellemons
JP Hellemons

Reputation: 6047

It has to do with the sessionstate. Normally Asp.Net webforms handles this by setting a cookie. So that the server side can determine which user is which.

But if you have sessionState in the web.config configured to be cookieless, it will append a random string to each url to identify the users session.

http://msdn.microsoft.com/en-us/library/h6bb9cz9%28v=vs.85%29.aspx

How does ASP.Net Cookieless work ?

Upvotes: 1

Related Questions