Basically, session_save_path
returns the path of the current directory used to save session data. We can set the path for it, ex: session_save_path('var/session')
. If we didn't set any path value, the session data will store in the tmp
folder of our web service. This is reason why when calling session_save_path()
, it returns c:\xampp\tmp
in your case.
Look into this file:
downloader/Maged/Controller.php
protected function cleanCache()
{
......
Mage::app()->cleanAllSessions();
......
}
As we can see,Mage::app()->cleanAllSessions()
is used for updating process. And, we don't set any value for session_save_path
in this process, so, the tmp
folder will store the session data. After updating successfully, we need to clear these values.
Now, we should find the session path of our Magento website.
Navigate to the core model session files:
app/code/core/Mage/Core/Model/Session/Abstract.php
public function getSessionSavePath()
{
if (Mage::isInstalled() && $sessionSavePath = Mage::getConfig()->getNode(self::XML_NODE_SESSION_SAVE_PATH)) {
return $sessionSavePath;
}
return parent::getSessionSavePath();
}
app/code/core/Mage/Core/Model/Session/Abstract/Varien.php
public function getSessionSavePath()
{
return Mage::getBaseDir('session');
}
The session save path will be set if we have set this value in app/etc/local.xml
. If not, it gets the path from Mage::getBaseDir('session')
-> var/session
will be used.
Try with an example:
app/etc/local.xml
<global>
......
<session_save_path><![CDATA[var/store_session]]></session_save_path>
......
</global>
Print out the value:
app/code/core/Mage/Core/Model/Session/Abstract.php
public function getSessionSavePath()
{
if (Mage::isInstalled() && $sessionSavePath = Mage::getConfig()->getNode(self::XML_NODE_SESSION_SAVE_PATH)) {
var_dump($sessionSavePath);
die;
return $sessionSavePath;
}
return parent::getSessionSavePath();
}
object(Mage_Core_Model_Config_Element)#26 (1) { [0]=> string(17)
"var/store_session" }