Skip to content

Bug: RedisHandler does not working on sessionExpiration is zero #3111

Description

@fz19

Describe the bug
RedisHandler does not working on sessionExpiration=0.

CodeIgniter 4 version
v4.0.3

Affected module(s)
CodeIgniter\Session\Handlers\RedisHandler

Expected behavior, and steps to reproduce if appropriate
i changed to redis session handler.
a website responded very slow and occured error.

Session: Unable to obtain lock for ci_session:1ifssq8spcfduehb418uk09fajq92li3 after 30 attempts, aborting.

i trace to this error. it seem to fail set value to Redis because sessionExpiration is zero.

if ($this->redis->set($this->keyPrefix . $sessionID, $sessionData, $this->sessionExpiration))

ci4 docs say sessionExpiration=0 is "non-expiring session (until browser is closed)" but it actually work to set TTL zero (then set action fail)

Please consider this issue.
thank you.

Context

  • OS: CentOS Linux release 8.1.1911
  • Web server: nginx/1.17.6
  • PHP version: 7.4.3 (php-fpm)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugVerified issues on the current code behavior or pull requests that will fix them

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions