Hot answers tagged

8 votes
Accepted

How does the akeeba backup actually work for cron jobs

I am the developer of Akeeba Backup. There are two different CRON scripts supplied with Akeeba Backup Professional. The recommended method is using the native CRON script which bypasses the web ...
user avatar
  • 521
7 votes
Accepted

What differences (if any) are there between JFactory::getSession() and $mainframe->getSession()?

The global variable $mainframe was remove in Joomla 1.6 and therefore will not work from that version onwards. global $mainframe should be replaced with $mainframe = JFactory::getApplication(); but ...
user avatar
  • 26.5k
7 votes
Accepted

Joomla Session->isActive() & session timeout redirect not working

If you look at the session.php file, you see the following: public function isActive() { return (bool) ($this->_state == 'active'); } Which is the function you're calling. I'm not sure if ...
user avatar
  • 26.5k
7 votes

Old sessions not being automatically deleted from the database

I believe changes were made to Joomla with the release of version 3.8.4, and that the session table will no longer be cleared if using 'Database' as the session handler. See this page on Github. The ...
user avatar
6 votes
Accepted

What differences (if any) are there between Joomla sessions and php sessions?

JSession is based on the standard PHP session handling mechanism but I would not say they are interchangeable, as Joomla is directly "talking" to JSession and not to the super global. In backend you ...
user avatar
6 votes

Session Handler, "Database" or "None"?

Similar to @codinghands's answer, writing the session to the database caused us to have too many connections: https://stackoverflow.com/questions/14506124/joomla-is-causing-too-many-connections-...
user avatar
6 votes
Accepted

Old sessions not being automatically deleted from the database

I've got a solution after reading the various pull requests on GitHub as pointed out above by Adam Gatt and Drew G. In the summary of changes for github.com/joomla/joomla-cms/pull/19548, is says that ...
user avatar
  • 492
6 votes
Accepted

Do Joomla sessions for guests expire at different periods of time than logged in users?

No, it is not expected behavior that sessions for guests expire faster than sessions for admins. Front-end and back-end users all use the same Session Lifetime which you configure in Administrator > ...
user avatar
  • 1,348
5 votes
Accepted

Joomla custom session data is overwritten

It looks like you're creating a new cart array instead of starting with your stored data. Try this: $session = JFactory::getSession(); $cart = $session->get('cart',array('items'=>array())); $...
user avatar
  • 585
4 votes

Override default php session

Edit: It seams that the answer is not correct. The default Joomla Session Handler (Database) does not lock the session while processing. So you don't have to worry about locking. Anyway its possible ...
user avatar
4 votes

Cannot log in to Joomla (front and back) after site move

It's hard to say exactly what's wrong, but here are some things you can try (please backup your configuration.php and .htaccess files before making any changes). Although you say your username/...
user avatar
  • 13.3k
4 votes
Accepted

Not able to store a Object in Joomla session

It's simple, your var $temp is a reference of the session object. So if you change the content of the object you change the session object itself. You have to clone the object: $temp = clone $...
user avatar
4 votes

How to make a notice that session is expiring in Joomla?

There's actually a free Joomla! extension that will do just this. It's called Session Keeper and you can view it in the JED here: Session Keeper It worked for my site when I utilized it, so ...
user avatar
4 votes

How to make a notice that session is expiring in Joomla?

Regarding why your session was not expiring, if you were on a page that had a Joomla login module, the session would never time out. The Joomla login module enables keepalive for all pages where it ...
user avatar
  • 2,330
3 votes

Updating User session to reflect latest access level changes

This is a very common problem in Joomla installs and to be honest there isn't a super simple fix. We've implemented a limited fix in 3.4 which allows you to clear the access rights cached for the ...
user avatar
3 votes

How to load Joomla session from external AJAX call

To load the session you need to get it from JFactory. $session = JFactory::getSession(); Read more on How to access session variables set by an external script.
user avatar
3 votes
Accepted

Joomla CSRF form validation

FoF has a handy _csrfProtection routine in the controller, with several ways to check the token: JUtility::getToken() (for Joomla 2.5, removed from Joomla 3.x) $session->getToken() $session->...
user avatar
  • 7,415
3 votes

What differences (if any) are there between Joomla sessions and php sessions?

Joomla uses the PHP session functions to create its JSession object, but it provides wrapper functions and namespaces the session to keep the data segregated. If you dump the PHP superglobal $_SESSION ...
user avatar
  • 1,089
3 votes

What differences (if any) are there between JFactory::getSession() and $mainframe->getSession()?

As for ressources about $mainframe: http://docs.joomla.org/J2.5:What's_new_in_Joomla_2.5 http://docs.joomla.org/Adapting_a_Joomla_1.5_extension_to_Joomla_1.6#Global_Variables_.28.24option_and_....
user avatar
  • 5,527
3 votes
Accepted

Retrieve joomla session from within a module

Your using the wrong session. If you follow the logic down the class chain for $mainframe->initialize you will find, depending on your version of joomla, a line like https://github.com/joomla/...
user avatar
  • 101
3 votes

Session Handler, "Database" or "None"?

Just to add my 2 cents: I've found in earlier versions of Joomla that the _sessions table often becomes corrupted on sites receiving a large number of unique visitors and hence open sessions, bringing ...
user avatar
  • 2,295
3 votes
Accepted

Session Handler, "Database" or "None"?

In the none option it use the default php session handle, which use files to store the session data. In the database option it use the database to store the session data. In http://www.tuxradar.com/...
user avatar
3 votes

Override default php session

Welcome to the world of asynchronous calls. My advice is don't use sessions for the AJAX/RESTful calls at all. The most I would do is have some sort of authentication token so you know who is making ...
user avatar
3 votes
Accepted

Override default php session

You don't have to write your own JSession class, but you'll need to write a class extending JSessionStorage to integrate with Joomla's session handling. Most likely you'll run into trouble when ...
user avatar
3 votes

Modify standard redirect url after session time out

You could write a template override for the login template being called when the standard login url is displayed. There you create a HTTP 302 Move response status. Or you write a url rewrite to your ....
user avatar
  • 368
3 votes
Accepted

Update quantity of the same item in the session instead of adding new one

Solution A: Slightly adjusted array structure You have only your itemid and the corresponding quantity in your array. Why don't you use the itemid as array index ($cart['items'][<ITEMID>]) so ...
user avatar
  • 3,693
3 votes

How to disable storing session for guest or public to Joomla table

Another way to reduce the server load is to make the session table of memory type. You need to set mysqls heap size quite large and convert the blob field in session into a large varchar, say 15000 ...
user avatar
  • 953
3 votes
Accepted

Get Session Value in Joomla

var id='<?php $s = JFactory::getSession(); echo $s->getId();?>'; console.log(id); Simple. That's enough internet for today. For more information on accessing session information please see ...
user avatar
  • 694
3 votes
Accepted

How to write the logged in user id in Plotalot queries?

Plotalot includes various variables that can be used in sql queries, eg. %%J_USER_ID%% is the currently logged in user_id. The Plotalot User Documentation Available as PDF here
user avatar
  • 3,134
3 votes
Accepted

Failed to Read Session Data After Renaming DB

Found the answer. When I renamed the database I also had to re-assign the database user to this database.
user avatar
  • 3,501

Only top scored, non community-wiki answers of a minimum length are eligible