Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I've had a similar problem (though I wanted to use data from the CMS Made Simple session in another php-file). For me the cause was the following (as stated in my comment on the question):</p> <p>CMS Made Simple (CMS from now on) does makes its own session name. This means that when you run session_start() in a separate php-file, it will not have the same session name. Therefore, the php-file won't be able to access CMS's session data, and CMS won't be able to access the php-file's session data.</p> <p>The solution logically follows from the cause, you need them both to use the same session name. CMS sets its session name in <code>include.php</code> which should be in the app's root folder.</p> <pre><code>$dirname = dirname(__FILE__); ... $session_key = substr(md5($dirname), 0, 8); #Setup session with different id and start it @session_name('CMSSESSID' . $session_key); </code></pre> <p>So, in your php file you will need to do the following (<em>before</em> calling <code>session_start();</code>):</p> <pre><code>//Substitute the string $dirname for the result of __FILE__ in **include.php**!!! $dirname = '/data/web/somefolder/someotherfolder/' $session_key = substr(md5($dirname), 0, 8); @session_name('CMSSESSID' . $session_key); //Now you can call session_start(); </code></pre> <p>Doing this lets your php-file access CMS's Session. If you use any plugins that put essential data in the session, you'll want to be careful not to erase any of that data.</p> <p>NOTE: I use CMS version 1.8.2, this solution may not work if you use a different version.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload