Share session in simple machine forum to subdomain

RandomC

New Member
I've deployed simple machine forum at smf.com domain, and than I created simple application to read session from the smf.com, but i deployed the simple application in the subdoamin, let say I put my simple application in simple.smf.comIn order to read session from domain, I must put ini_set("session.cookie_domain",".smf.com"); before session start. I must put it in the smf project file and also simple aplication too.where I should put ini_set("session.cookie_domain",".smf.com") so it will by pass to the session start.I have put the ini_set("session.cookie_domain",".smf.com") in the load.php file\[code\]function loadSession(){ global $HTTP_SESSION_VARS, $modSettings, $boardurl, $sc; // Attempt to change a few PHP settings. @ini_set("session.cookie_domain",".smf.com"); @ini_set('session.use_cookies', true); @ini_set('session.use_only_cookies', false); @ini_set('url_rewriter.tags', ''); @ini_set('session.use_trans_sid', false); @ini_set('arg_separator.output', '&');}\[/code\]while I try to read cookie form subdomain. It couldn't read the domain session. my subdomain code is:\[code\]<?php ini_set("session.cookie_domain",".smf.com"); session_start(); print_r($_SESSION);?>\[/code\]
 
Back
Top