PHP $_SESSION value differs on www
<p>I have a website. People can login it on here</p>

<pre><code>sub.domain.com
</code></pre>

<p>If they login here, the session will do its job and user will be logged in. On any page at sub.domain.com, the session value be will returned so it will work fine.</p>

<p>But site can also be reached from www.sub.domain.com . When user logins at sub.domain.com, the session value is empty at www.sub.domain.com.
I mean if user logs in at sub.domain.com,
When he navigates to www.sub.domain.com, site will say 'please login', but user was already logged in at site without 'www'.
Hope it was all clear, thank you.</p>
