PHP Session Across Subdomains

//if(youLikeIt || itHelpsYou)clickShare();

By default, PHP not allowed to create Session across subdomains. For example, Session that you create in will not readable in, vice versa.

The code below will allow Session across subdomains.

//add this line before session_start()
ini_set('session.cookie_domain', '' );

//$_SESSION['test'] will readable in every subdomains.

Congratulate smiley

//if(youLikeIt || itHelpsYou)clickShare();
Take a Break //non-technical articles
Hot Topics //most used tags
Email Subscriptions //We won't spam you. Honest!

Enter your email address:

Delivered by FeedBurner