使用www时会话无法启动

I have a strange problem here.

I am using a directory script running off PHP.

The users have the option to type in their postcode so the directory can use their postcode to find local businesses.

I am using a session to save their postcode.

The problem is when the session postcode ($_SESSION['postcode']) doesn't show when I leave out the "www." in the domain. How can I set it so the postcode will show with/without the www.?

Thanks Peter

session_set_cookie_params(0, '/', '.domain.com');

I used the following code and it worked :)

RewriteEngine on RewriteBase / RewriteCond %{HTTP_HOST} ^www.mywebsite.org RewriteRule ^(.*)$ http://mywebsite.org/$1 [R=permanent,L]