To start a session, sesson_start:
session_start();
add a value to a session:
$_SESSION['name'] = 'value';
End a session, session_destroy:
session_destroy();
Save path for sessions, session_save_path:
题
I've left ColdFusion and trying to get up to speed with PHP. First off, in building an app I'm trying to set an Application variable for the include paths, in CF I would use Application.FilePath = "/myWebApp/" and use to set up all includes template files. In PHP I'm not finding something similar.
I'm also struggling with setting Session specific variables. In CF, I would also set them in the Application.cfc/Application.cfm file as session.mySessionVarName. In PHP I'm not seeing a similar place to put these so they're available throughout the webapp, and the current session.
I thought this may be a common question but I didn't find anything related.
Thank you for your time.
解决方案
To start a session, sesson_start:
session_start();
add a value to a session:
$_SESSION['name'] = 'value';
End a session, session_destroy:
session_destroy();
Save path for sessions, session_save_path: