<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://docs.sandbox.joomla.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Floris</id>
	<title>Joomla! Documentation - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://docs.sandbox.joomla.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Floris"/>
	<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/Special:Contributions/Floris"/>
	<updated>2026-09-27T02:35:07Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=How_to_access_session_variables_set_by_an_external_script&amp;diff=28668</id>
		<title>How to access session variables set by an external script</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=How_to_access_session_variables_set_by_an_external_script&amp;diff=28668"/>
		<updated>2010-06-12T08:25:17Z</updated>

		<summary type="html">&lt;p&gt;Floris: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Situation: when you call a session variable in Joomla from an external script, it appears to be empty.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Solution:&lt;br /&gt;
Replace session_start(); in your external script with&lt;br /&gt;
&amp;lt;source lang=php&amp;gt;&lt;br /&gt;
define( &#039;_JEXEC&#039;, 1 );&lt;br /&gt;
define( &#039;JPATH_BASE&#039;, realpath(dirname(__FILE__).&#039;/../..&#039; ));&lt;br /&gt;
define( &#039;DS&#039;, DIRECTORY_SEPARATOR );&lt;br /&gt;
&lt;br /&gt;
require_once ( JPATH_BASE .DS.&#039;includes&#039;.DS.&#039;defines.php&#039; );&lt;br /&gt;
require_once ( JPATH_BASE .DS.&#039;includes&#039;.DS.&#039;framework.php&#039; );&lt;br /&gt;
$mainframe =&amp;amp; JFactory::getApplication(&#039;site&#039;);&lt;br /&gt;
$mainframe-&amp;gt;initialise();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Be sure to change JPATH_BASE to suit your directory structure.&lt;br /&gt;
&lt;br /&gt;
Replace the $_SESSION[ &#039;name&#039; ] = &amp;quot;value&amp;quot;; in your external script with&lt;br /&gt;
&amp;lt;source lang=php&amp;gt;&lt;br /&gt;
$session =&amp;amp; JFactory::getSession();&lt;br /&gt;
$session-&amp;gt;set(&#039;name&#039;, &amp;quot;value&amp;quot;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now you can retrieve this session variable using:&lt;br /&gt;
&amp;lt;source lang=php&amp;gt;&lt;br /&gt;
$session =&amp;amp; JFactory::getSession();&lt;br /&gt;
echo $session-&amp;gt;get(&#039;name&#039;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Floris</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=How_to_access_session_variables_set_by_an_external_script&amp;diff=28667</id>
		<title>How to access session variables set by an external script</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=How_to_access_session_variables_set_by_an_external_script&amp;diff=28667"/>
		<updated>2010-06-12T08:24:52Z</updated>

		<summary type="html">&lt;p&gt;Floris: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Situation: when you call a session variable in Joomla from an external script, it appears to be empty.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Solution:&lt;br /&gt;
Replace session_start(); in your external script with&lt;br /&gt;
&amp;lt;source lang=php&amp;gt;&lt;br /&gt;
define( &#039;_JEXEC&#039;, 1 );&lt;br /&gt;
define( &#039;JPATH_BASE&#039;, realpath(dirname(__FILE__).&#039;/../..&#039; ));&lt;br /&gt;
define( &#039;DS&#039;, DIRECTORY_SEPARATOR );&lt;br /&gt;
&lt;br /&gt;
require_once ( JPATH_BASE .DS.&#039;includes&#039;.DS.&#039;defines.php&#039; );&lt;br /&gt;
require_once ( JPATH_BASE .DS.&#039;includes&#039;.DS.&#039;framework.php&#039; );&lt;br /&gt;
$mainframe =&amp;amp; JFactory::getApplication(&#039;site&#039;);&lt;br /&gt;
$mainframe-&amp;gt;initialise();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Be sure to change JPATH_BASE to suit your directory structure.&lt;br /&gt;
&lt;br /&gt;
Replace the $_SESSION[ &#039;name&#039; ] = &amp;quot;value&amp;quot;; in your external script with&lt;br /&gt;
&amp;lt;source lang=php&amp;gt;&lt;br /&gt;
$session =&amp;amp; JFactory::getSession();&lt;br /&gt;
$session-&amp;gt;set(&#039;name&#039;, &amp;quot;value&amp;quot;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now you can retreive this session variable using:&lt;br /&gt;
&amp;lt;source lang=php&amp;gt;&lt;br /&gt;
$session =&amp;amp; JFactory::getSession();&lt;br /&gt;
echo $session-&amp;gt;get(&#039;name&#039;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Floris</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=How_to_access_session_variables_set_by_an_external_script&amp;diff=28666</id>
		<title>How to access session variables set by an external script</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=How_to_access_session_variables_set_by_an_external_script&amp;diff=28666"/>
		<updated>2010-06-12T08:23:51Z</updated>

		<summary type="html">&lt;p&gt;Floris: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Situation: when you call a session variable in Joomla from an external script, it appears to be empty.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Solution:&lt;br /&gt;
Replace session_start(); in your external script with&lt;br /&gt;
&amp;lt;source lang=php&amp;gt;&lt;br /&gt;
define( &#039;_JEXEC&#039;, 1 );&lt;br /&gt;
define( &#039;JPATH_BASE&#039;, realpath(dirname(__FILE__).&#039;/../..&#039; ));&lt;br /&gt;
define( &#039;DS&#039;, DIRECTORY_SEPARATOR );&lt;br /&gt;
&lt;br /&gt;
require_once ( JPATH_BASE .DS.&#039;includes&#039;.DS.&#039;defines.php&#039; );&lt;br /&gt;
require_once ( JPATH_BASE .DS.&#039;includes&#039;.DS.&#039;framework.php&#039; );&lt;br /&gt;
$mainframe =&amp;amp; JFactory::getApplication(&#039;site&#039;);&lt;br /&gt;
$mainframe-&amp;gt;initialise();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Be sure to change JPATH_BASE to suit your directory structure.&lt;br /&gt;
&lt;br /&gt;
Replace the $_SESSION[ &#039;name&#039; ] = &amp;quot;value&amp;quot;; in your external script with&lt;br /&gt;
&amp;lt;source lang=php&amp;gt;&lt;br /&gt;
$session =&amp;amp; JFactory::getSession();&lt;br /&gt;
$session-&amp;gt;set(&#039;name&#039;, &amp;quot;value&amp;quot;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now you can call this session variable using:&lt;br /&gt;
&amp;lt;source lang=php&amp;gt;&lt;br /&gt;
$session =&amp;amp; JFactory::getSession();&lt;br /&gt;
echo $session-&amp;gt;get(&#039;name&#039;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Floris</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=How_to_access_session_variables_set_by_an_external_script&amp;diff=28665</id>
		<title>How to access session variables set by an external script</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=How_to_access_session_variables_set_by_an_external_script&amp;diff=28665"/>
		<updated>2010-06-12T08:23:30Z</updated>

		<summary type="html">&lt;p&gt;Floris: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Situation: when you call a session variable in Joomla from an external script, it appears to be empty.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Solution:&lt;br /&gt;
Replace session_start(); in your external script with&lt;br /&gt;
&amp;lt;source lang=html4strict&amp;gt;&lt;br /&gt;
define( &#039;_JEXEC&#039;, 1 );&lt;br /&gt;
define( &#039;JPATH_BASE&#039;, realpath(dirname(__FILE__).&#039;/../..&#039; ));&lt;br /&gt;
define( &#039;DS&#039;, DIRECTORY_SEPARATOR );&lt;br /&gt;
&lt;br /&gt;
require_once ( JPATH_BASE .DS.&#039;includes&#039;.DS.&#039;defines.php&#039; );&lt;br /&gt;
require_once ( JPATH_BASE .DS.&#039;includes&#039;.DS.&#039;framework.php&#039; );&lt;br /&gt;
$mainframe =&amp;amp; JFactory::getApplication(&#039;site&#039;);&lt;br /&gt;
$mainframe-&amp;gt;initialise();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Be sure to change JPATH_BASE to suit your directory structure.&lt;br /&gt;
&lt;br /&gt;
Replace the $_SESSION[ &#039;name&#039; ] = &amp;quot;value&amp;quot;; in your external script with&lt;br /&gt;
&amp;lt;source lang=html4strict&amp;gt;&lt;br /&gt;
$session =&amp;amp; JFactory::getSession();&lt;br /&gt;
$session-&amp;gt;set(&#039;name&#039;, &amp;quot;value&amp;quot;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now you can call this session variable using:&lt;br /&gt;
&amp;lt;source lang=html4strict&amp;gt;&lt;br /&gt;
$session =&amp;amp; JFactory::getSession();&lt;br /&gt;
echo $session-&amp;gt;get(&#039;name&#039;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Floris</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=How_to_access_session_variables_set_by_an_external_script&amp;diff=28664</id>
		<title>How to access session variables set by an external script</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=How_to_access_session_variables_set_by_an_external_script&amp;diff=28664"/>
		<updated>2010-06-12T08:22:14Z</updated>

		<summary type="html">&lt;p&gt;Floris: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Situation: when you call a session variable in Joomla from an external script, it appears to be empty.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Solution:&lt;br /&gt;
Replace session_start(); in your external script with&lt;br /&gt;
&amp;lt;source&amp;gt;&lt;br /&gt;
define( &#039;_JEXEC&#039;, 1 );&lt;br /&gt;
define( &#039;JPATH_BASE&#039;, realpath(dirname(__FILE__).&#039;/../..&#039; ));&lt;br /&gt;
define( &#039;DS&#039;, DIRECTORY_SEPARATOR );&lt;br /&gt;
&lt;br /&gt;
require_once ( JPATH_BASE .DS.&#039;includes&#039;.DS.&#039;defines.php&#039; );&lt;br /&gt;
require_once ( JPATH_BASE .DS.&#039;includes&#039;.DS.&#039;framework.php&#039; );&lt;br /&gt;
$mainframe =&amp;amp; JFactory::getApplication(&#039;site&#039;);&lt;br /&gt;
$mainframe-&amp;gt;initialise();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Be sure to change JPATH_BASE to suit your directory structure.&lt;br /&gt;
&lt;br /&gt;
Replace the $_SESSION[ &#039;name&#039; ] = &amp;quot;value&amp;quot;; in your external script with&lt;br /&gt;
&amp;lt;source&amp;gt;&lt;br /&gt;
$session =&amp;amp; JFactory::getSession();&lt;br /&gt;
$session-&amp;gt;set(&#039;name&#039;, &amp;quot;value&amp;quot;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now you can call this session variable using:&lt;br /&gt;
&amp;lt;source&amp;gt;&lt;br /&gt;
$session =&amp;amp; JFactory::getSession();&lt;br /&gt;
echo $session-&amp;gt;get(&#039;name&#039;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Floris</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=How_to_access_session_variables_set_by_an_external_script&amp;diff=28663</id>
		<title>How to access session variables set by an external script</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=How_to_access_session_variables_set_by_an_external_script&amp;diff=28663"/>
		<updated>2010-06-12T08:21:32Z</updated>

		<summary type="html">&lt;p&gt;Floris: New page: Situation: when you call a session variable in Joomla from an external script, it appears to be empty.   Solution: Replace session_start(); in your external script with &amp;lt;source lang=html&amp;gt; ...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Situation: when you call a session variable in Joomla from an external script, it appears to be empty.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Solution:&lt;br /&gt;
Replace session_start(); in your external script with&lt;br /&gt;
&amp;lt;source lang=html&amp;gt;&lt;br /&gt;
define( &#039;_JEXEC&#039;, 1 );&lt;br /&gt;
define( &#039;JPATH_BASE&#039;, realpath(dirname(__FILE__).&#039;/../..&#039; ));&lt;br /&gt;
define( &#039;DS&#039;, DIRECTORY_SEPARATOR );&lt;br /&gt;
&lt;br /&gt;
require_once ( JPATH_BASE .DS.&#039;includes&#039;.DS.&#039;defines.php&#039; );&lt;br /&gt;
require_once ( JPATH_BASE .DS.&#039;includes&#039;.DS.&#039;framework.php&#039; );&lt;br /&gt;
$mainframe =&amp;amp; JFactory::getApplication(&#039;site&#039;);&lt;br /&gt;
$mainframe-&amp;gt;initialise();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Be sure to change JPATH_BASE to suit your directory structure.&lt;br /&gt;
&lt;br /&gt;
Replace the $_SESSION[ &#039;name&#039; ] = &amp;quot;value&amp;quot;; in your external script with&lt;br /&gt;
&amp;lt;source lang=html&amp;gt;&lt;br /&gt;
$session =&amp;amp; JFactory::getSession();&lt;br /&gt;
$session-&amp;gt;set(&#039;name&#039;, &amp;quot;value&amp;quot;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now you can call this session variable using:&lt;br /&gt;
&amp;lt;source lang=html&amp;gt;&lt;br /&gt;
$session =&amp;amp; JFactory::getSession();&lt;br /&gt;
echo $session-&amp;gt;get(&#039;name&#039;);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Floris</name></author>
	</entry>
</feed>