2

I have a site at GoDaddy. You may access it using a www prefix or not. It works fine either way unless you happen to hit a link that uses/does not use the prefix. Then the session disappears. Is www.example.com supposed to be the same as example.com? If not, how do I require the use of one or the other?

TRiG
  • 10,148
  • 7
  • 57
  • 107
user116032
  • 321
  • 2
  • 15

1 Answers1

2

Sessions are based on cookies, and cookies are bound to a specific domain. www.abc.com is a subdomain of abc.com (In some cases, you might not even be the owner of both).

I would force webserver to add a www prefix (with .htaccess if you are using Apache: Example here)

Community
  • 1
  • 1
Blazeag
  • 481
  • 8
  • 13