User tests: Successful: Unsuccessful:
1: In some cases, call an invalid URL, resulting in a response with code 404. (still refresh the session)
2: Update the article hits counter.
3: Work in different ways with "Search Engine Friendly URLs" enabled or disabled.
The session is refreshed but it isn't nice to generate a 404 error that, for example, ends up in the apache logs.
The counter was increased by 1+X where X is the number of ajax calls.
This is the same procedure to reproduce number 1 but ends with a different behavior that, if the homepage display an article, generate the same issue of number 2.
(This because the homepage of the site has been called.)
I modified the URL of the ajax call from "./" to:
JRoute::_("index.php?option=com_ajax&format=json", false)
This call refresh the session without generate any html and/or call model methods that can lead to unexpected/unwanted behaviors (for example in an increased article hits counter).
This call is available on both site and administrator applications.
To test it in the administrator application (for example) go to the edit category page that include the "behavior.keepalive" and wait for the ajax call.
Labels |
Added:
?
|
Labels |
Added:
?
|
I am sorry, I missed slash in my example, for url:
JUri::base(true) . '/index.php?option=com_ajax&format=json';
and thanks for this, I try test tomorrow
Easy | No | ⇒ | Yes |
Category | ⇒ | Libraries |
test
still works good
it is ready to "RTC" or?
the (at) symbol useless here
people use it as quick way to make "test" word bold
Status | Pending | ⇒ | Ready to Commit |
Thanks for the bump and the tests @Fedik and @demis-palma
RTC'ing now!
Labels |
Added:
?
|
Labels |
Added:
?
|
I notice that the session not always be refreshed if the session lifetime is set to 1 minute.
@Fedik and @demis-palma can check again that continue to works well to you too?
(sorry for the inconveniente)
I also noticed that the session lifetime can be set a zero or negative value in the configuration page.
Zero behavior is equals to default of 15 minutes.
Negative value cause the impossibility to use the application!
(created the issue #6954 for this)
@maxvalentini77 I already use this on my sites, where default session handler is File or APC,
and refresh session each minute works good, if compare with original
session lifetime 1 minute I think have not much sense, not sure that we need to worry about it
but maybe someone has better arguments
Thank you @maxvalentini77! Merged.
Status | Ready to Commit | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2015-07-06 15:03:22 |
Closed_By | ⇒ | Kubik-Rubik |
thanks @maxvalentini77
I had similar idea, and found this is already suggested couple months ago
couple note:
you do not need to call
JRoute
as it useless here, enough:JUri::base(true) . 'index.php?option=com_ajax&format=json';
and can you please make
$refreshTime
fixed, example 1 minute , so we could solve also that issue #6730something like: