Browse Source

Change session lifetimes to more closely match TTRSS

At least some clients seem to expect the default timeout of one day.
microsub
J. King 6 years ago
parent
commit
ddf55e0665
  1. 1
      README.md
  2. 8
      lib/Conf.php
  3. 5
      tests/lib/Database/SeriesCleanup.php
  4. 5
      tests/lib/Database/SeriesSession.php

1
README.md

@ -135,7 +135,6 @@ We are not aware of any other extensions to the TTRSS protocol. If you know of a
- Input that cannot be parsed as JSON normally returns a `NOT_LOGGED_IN` error; The Arsse returns a non-standard `MALFORMED_INPUT` error instead
- Feed, category, and label names are normally unrestricted; The Arsse rejects empty strings, as well as strings composed solely of whitespace
- Discovering multiple feeds during `subscribeToFeed` processing normally produces an error; The Arsse instead chooses the first feed it finds
- Log-in session lifetime is intentionally shorter in The Arsse
- Providing the `setArticleLabel` operation with an invalid label normally silently fails; The Arsse returns an `INVALID_USAGE` error instead
- Article hashes are normally SHA1; The Arsse uses SHA256 hashes
- Article attachments normally have unique IDs; The Arsse always gives attachments an ID of `"0"`

8
lib/Conf.php

@ -32,12 +32,12 @@ class Conf {
public $userPreAuth = false;
/** @var integer Desired length of temporary user passwords */
public $userTempPasswordLength = 20;
/** @var string Period of inactivity after which log-in sessions should be considered invalid, as an ISO 8601 duration (default: 1 hour)
/** @var string Period of inactivity after which log-in sessions should be considered invalid, as an ISO 8601 duration (default: 24 hours)
* @see https://en.wikipedia.org/wiki/ISO_8601#Durations */
public $userSessionTimeout = "PT1H";
/** @var string Maximum lifetime of log-in sessions regardless of activity, as an ISO 8601 duration (default: 24 hours);
public $userSessionTimeout = "PT24H";
/** @var string Maximum lifetime of log-in sessions regardless of activity, as an ISO 8601 duration (default: 7 days);
* @see https://en.wikipedia.org/wiki/ISO_8601#Durations */
public $userSessionLifetime = "PT24H";
public $userSessionLifetime = "P7D";
/** @var string Class of the background feed update service driver in use (Forking by default) */
public $serviceDriver = Service\Forking\Driver::class;

5
tests/lib/Database/SeriesCleanup.php

@ -11,6 +11,11 @@ use Phake;
trait SeriesCleanup {
public function setUpSeries() {
// set up the configuration
Arsse::$conf->import([
'userSessionTimeout' => "PT1H",
'userSessionLifetime' => "PT24H",
]);
// set up the test data
$nowish = gmdate("Y-m-d H:i:s", strtotime("now - 1 minute"));
$yesterday = gmdate("Y-m-d H:i:s", strtotime("now - 1 day"));

5
tests/lib/Database/SeriesSession.php

@ -12,6 +12,11 @@ use Phake;
trait SeriesSession {
public function setUpSeries() {
// set up the configuration
Arsse::$conf->import([
'userSessionTimeout' => "PT1H",
'userSessionLifetime' => "PT24H",
]);
// set up the test data
$past = gmdate("Y-m-d H:i:s", strtotime("now - 1 minute"));
$future = gmdate("Y-m-d H:i:s", strtotime("now + 1 minute"));

Loading…
Cancel
Save