Skip to content

Fix for: zero or negative values on session lifetime.#6954

Closed
maxvalentini77 wants to merge 3 commits intojoomla:stagingfrom
maxvalentini77:fix-zero-negative-session-lifetime
Closed

Fix for: zero or negative values on session lifetime.#6954
maxvalentini77 wants to merge 3 commits intojoomla:stagingfrom
maxvalentini77:fix-zero-negative-session-lifetime

Conversation

@maxvalentini77
Copy link
Copy Markdown
Contributor

Zero or negative values on session lifetime

Session lifetime is an integer value and should be setted to a positive value greater than zero.

  • Negative value cause that the session to be always "expired".
  • Zero behavior is equals to the default value of 15 minute, this behavior is not explict and can be obtained setting 15 minutes of lifetime, so i remove zero from the valid range.

Setted a minimum of 1 to session lifetime.
@zero-24
Copy link
Copy Markdown
Contributor

zero-24 commented May 15, 2015

How to test

  • try to insert and save a value of zero as session time
  • make sure no issues are reported
  • apply the patch
  • try zero again
  • repeat the test with 1 and 2 as values (both should work)

Thanks @maxvalentini77


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6954.

@Fedik
Copy link
Copy Markdown
Member

Fedik commented May 16, 2015

I still able to save negative value:
screen 2015-05-16 13 46 52 492x135

@Fedik
Copy link
Copy Markdown
Member

Fedik commented May 16, 2015

I think problem that there no backend validation for this input,
also filter="integer" allow negative value (that is valid),
min="1" have not much effect at least in my Chrome browser 😄

same problem with "Cache Time" in same configuration form

@izharaazmi
Copy link
Copy Markdown
Contributor

@maxvalentini77 I suggest to add filter="uint" as well to the field, though I don't see it as necessary.

@maxvalentini77
Copy link
Copy Markdown
Contributor Author

@Fedik You are right, I'm working on a server side validation.
@izharaazmi Thanks for the tip!

@maxvalentini77
Copy link
Copy Markdown
Contributor Author

Added number validator to check min/max range for number fields.
Added the validator to cachetime and session lifetime, both setted with min of 1.

@zero-24
Copy link
Copy Markdown
Contributor

zero-24 commented May 30, 2015

RTC based on testing by @ChrisBreaks and @jonnyefftek on #jab15 #makeithappen


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6954.

@zero-24 zero-24 added the RTC This Pull Request is Ready To Commit label May 30, 2015
@watchfulli-dev
Copy link
Copy Markdown

@test test resutls are: without patch applied, there's no error displayed and you can enter 0 inside "Session Lifetime " field. After applying the patch if you try to enter 0 as a value inside "Session Lifetime " field, you get this error: "Invalid field: Session Lifetime"


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6954.

@Bakual Bakual modified the milestones: Joomla! 3.4.2, Joomla! 3.5.0 Jun 3, 2015
Bakual pushed a commit that referenced this pull request Jun 3, 2015
@Bakual
Copy link
Copy Markdown
Contributor

Bakual commented Jun 3, 2015

Merged with b649299 into 3.5-dev.

Thanks!

Is there a list of available JFormRules somewhere? If so that would need updated as we introduce a new one here.

@Bakual Bakual closed this Jun 3, 2015
@peterlose
Copy link
Copy Markdown
Contributor

@Bakual Should the doc block say @since xx.x?

@maxvalentini77
Copy link
Copy Markdown
Contributor Author

I wrote xx.x in the attribute because i didn't know in which version this class will be introduced. Now should contain 3.5.0, right?

@zero-24
Copy link
Copy Markdown
Contributor

zero-24 commented Jun 3, 2015

Correct @maxvalentini77 can you just send a quick PR that fixes that?

@maxvalentini77
Copy link
Copy Markdown
Contributor Author

@zero-24 I create a new PR #7109 it's ok?

@Bakual
Copy link
Copy Markdown
Contributor

Bakual commented Jun 3, 2015

Awww. I usually don't look at the doc blocks close enough...

@zero-24
Copy link
Copy Markdown
Contributor

zero-24 commented Jun 3, 2015

@zero-24 I create a new PR #7109 it's ok?

👍 Thomas allready merged it. Thanks

roland-d pushed a commit that referenced this pull request Aug 6, 2015
@zero-24 zero-24 removed the RTC This Pull Request is Ready To Commit label Oct 14, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants