Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7510585
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T23:15:58+00:00 2026-05-29T23:15:58+00:00

Joomla 1.5.25 just upgraded from 1.5.23 having problems saving to session and persistency, works

  • 0

Joomla 1.5.25 just upgraded from 1.5.23 having problems saving to session and persistency, works perfectly on 1.5.23, but session data is not being saved to db when using JSession->set

Wrote custom app on top of joomla, managing users imported from legacy system cant use joomla Users for this ( or at least I haven’t and I dont have the time ), login works like follows:

  1. User posts email pass
  2. app checks if user exists
  3. if user exists I save the user object to session
  4. redirect user to resource

Here is the snippet for saving the user to session

$session   = JFactory::getSession();
$session->set('appUserData', array(
    'data' => $USER_OBJECT,
    'timestamp' => time(),
    'role' => 0,
    'permits' => $permits
);, "custom_namespace");

Now since I’m doing this outside the joomla scope I have to boostrap

define( '_JEXEC', 1 );
define( 'DS', DIRECTORY_SEPARATOR );
define('JPATH_BASE', dirname(dirname(__FILE__)));

require_once (JPATH_BASE . DS . 'includes' . DS . 'defines.php');
require_once (JPATH_BASE . DS . 'includes' . DS . 'framework.php');

Once I do $session->set() if I try $session->get() on the same script it does pull the full resource I just saved, but if I try to pull the $session from another script I get nothing, here is the Other script

<?php 
error_reporting(E_ALL);
define( '_JEXEC', 1 );
define( 'DS', DIRECTORY_SEPARATOR );
define('JPATH_BASE', dirname(dirname(__FILE__)));

require_once (JPATH_BASE . DS . 'includes' . DS . 'defines.php');
require_once (JPATH_BASE . DS . 'includes' . DS . 'framework.php');

$mainframe = JFactory::getApplication('site');
$session   = JFactory::getSession();

echo "<pre>";
print_r($_COOKIE);
print_r($session);
print_r($_SESSION);
echo "</pre>";
exit;

Here I only get my cookies array and the Array of the session with the default session info:

Array
(
    [__default] => Array
        (
            [session.counter] => 3
            [session.timer.start] => 1329168055
            [session.timer.last] => 1329168057
            [session.timer.now] => 1329168062
            [session.client.browser] => Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:10.0.1) Gecko/20100101 Firefox/10.0.1 FirePHP/0.7.0
        )

)

The db never gets updated with the contents of my newly created session variable, I tried doing some error_logs on the write db session adapter which is the one writing to db, and I think the problem is here ( libraries/joomla/session/storage/database.php ) line 82:

$session = &JTable::getInstance('session');
if ($session->load($id) == true) { /*...*/} // never entering here
else { /*...*/ } // always here

I tried outputting to the log the contents of $id and It does refer to a valid primary key id on the db

error_log('SELECT * FROM jos_session WHERE session_id = "' . $id . '"');

returns something like this SELECT * FROM jos_session WHERE session_id = “38e6468f35f1994425de3919fa767a3d”, which I can confirm returns a valid record, I tried pulling the old source from 1.5.23 here but even that wont make it work again, any ideas out there on what might have upgraded and made this fail?

**UPDATE**

I tried truncating the tables too, in fact I think the problem more specifically is that at some point the session fails on write to db, since I have multiple connections to mysql being used, the JSession Database Mysql Storage engine for the session gets confused, even weirder is that on an environment with pure 1.5.23 this confusion doesn’t occur, resources get created for each different connection, I went trough the changes from 1.5.23 to 1.5.25 and I can’t find anything related to DB resource management or any loose reference to the DBO object, I think I need to profile each connection and check where is the problem, Data lives on same mysql server but on different db’s

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T23:15:59+00:00Added an answer on May 29, 2026 at 11:15 pm

    Problem is JSession is using the database storage JsessionStorageDatabase since I’m connecting to multiple databases through out the script execution my mysql_connect calls weren’t really making a new connection, they were reusing the old causing the script to fail when it didn’t find the selected db which changed by the time the Storage adapter for JSession wanted to do a write

    See mysql_connect documentation here and check this question from another user which helped me understand my problem and come to a solution

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I just moved my Joomla! website from BradPPresents.com to BradP.com . No Nude, but
I just updated my joomla from 1.0.12 to 1.5 but the component remository doesn't
I've just written joomla module. This is basic but working version of my moule.
i'm using obsocial submit to submit articles from joomla to facebook. It publishes just
Just moved this Joomla 1.6 install over from iPower to Network Solutions. Moved a
I just installed Joomla on my pc. Everything works just fine. I installed a
i just bought a joomla template from template monster. there is photo gallery on
I'm using AutsonSlideShow extension for Joomla 1.7 which works just fine. The plugin has
I'm just starting to evaluate joomla CMS as a tool to build out my
A lot of Joomla Documentation talks about MVC, i'm just wondering if Joomla follows

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.