I am using sessions for my expressionengine project. I have used the following methods to set sessions at the top of the page.
if (session_id() == ''){
session_start();
} or
if(!isset($_SESSION)){
session_start();
}
or
if(empty($_SESSION['userid'])){
session_start();
}
I have written custom expression engine plugin where I do session check.
After sometime I observed a strange behaviour of sessions. It is getting set different for different url. for http:// url it sets differently and for www:// url it sets differently. How do I set and retrieve sessions such that both http://example.com and www.example.com will yeild same result.
I have followed steps from this url as well http://ellislab.com/forums/viewthread/231468/. I have posted the same issue on http://ellislab.com/forums/viewthread/232604/. But its not helping me.
Can someone help me on this.