6

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 > System > Global Configuration > [System] tab > Session Settings. However, Joomla's default edit forms (e.g. Article Edit) have some code JHtml::_('behavior....


3

One way I can imagine to check the session is before you ignite the above ajax call, you make a previous ajax call to another function in com_contract/controller(task = your new session checking function. so: url:...com_contract/task=checkSession) where you create a function, something like: public function checkSession() { try { $session1 =...


2

In that field data is split into namespaces. Namespace and its data is separated by |, so if you use explode('|',$data) you will achieve array where odd index element is an data array and each even index element is an namespace. Here is an example how to decode this variable into namespaces: $db = JFactory::getDbo(); $query = $db->getQuery(true); $query-&...


2

Your App initialization is not exactly the same than Joomla! CMS. Any minor difference can cause a condition to create a new session, instead of the reusing the original session. Instead of trying to load the session from an external file, you can just implement a controller task inside the CMS, to avoid any risk of not loading the same session.


2

All your page requests share the same user session. Thus, if you call several pages, in an asynchronic way, under the same session, you can be finding a race condition. http://en.wikipedia.org/wiki/Race_condition As PHP is not multithreading, there's no locking mechanisms to avoid these cases. The best solution is to avoid the condition: reorganize the ...


2

Yes, getExpire() returns result in seconds. As you can see here and here, they are converting lifetime value to seconds (default is 15 minutes, so 900 seconds). Documentation is automatically generated from source code. So you should create a new issue and describe the bug. Or I can do that. Let me know.


2

To get the session state, you can use the following: JFactory::getSession()->getState(); I'm not sure if this script is inline or a separate file. If it's inline then you can simply add the following to your Javascript: var sessionState = '<?php echo JFactory::getSession()->getState(); ?>'; if (sessionState === 'expired') { // redirect to ...


2

well after the valuable help of @Zollie I will post the answer and working code to help others. A sample of the template file : <form action="<?php echo JRoute::_('index.php?option=com_contract&view=contracts'); ?>" id="adminForm" method="post" name="adminForm"> <?php if (!empty($this->items)) { ?> <div class="...


2

I have had issues with this when the database is used as the session handler. From what I can gather, the session data isn't written to the database until the script has terminated. This means that if the second script starts running before the first finishes it would load the session data without the new values since it hasn't been written to the database ...


1

The above method is 100% correct and working. My own code, where I had my_custom_namespace had a typo - I was setting myNamespace and trying - and obviously failing - to get MyNamespace :Faceplam:


1

Ok I see the issue now. It's because you've overriding the session variable in the loop, each time. Instead, try this: First module $session = JFactory::getSession(); $modules = JModuleHelper::getModules('second-position'); for ($i=1; $i<5; $i++) { $session->set('number', $i); foreach($modules as $mod) { echo JModuleHelper::...


1

In joomla we had the Joomla Registration and login plugins and modules. if you can use it. it automatically generate the cookies also. use it. then you can get the good result.


1

OK, the problem is that we got to use the same session. In order to do that. We had to call $session->getId() to get current seeeion_id then send it to the client side, when we create the session and save the data. Then the client side should pass back the session_id when they want to retrieve back the session data, and we pass the seeeion_id as a one ...


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