Question

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.

Was it helpful?

Solution

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:

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top