I getting a exception to retrieve session value in following condition.
- if I open site with this link http://example.com and assign session value
- Page will be redirect to the another site http://example1.com.
- some action at http://example1.com
- redirect to http://www.example.com (not http://example.com) and retrieve session value
in this situation system throw exception… but if i open site with http://www.example.com then working fine.
I have some questions
- Difference between http://example.com and http://www.example.com?
- how can resolve that problem because it is not necessary that user will type http://www.example.com.
Putting it very simply, http://site.com and http://www.site.com are two separate sites. This is because of the way DNS is setup for a domain name. You can configure the DNS record for a domain name to point both at the same IP address, or you could use a URLRewrite rule to force traffic one way or the other.
Take a look at this for more info:
Specify a canonical domain name for your site with IIS 7