Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]: 'prefix' option does not work for Phalcon\Session\Adapter\Redis #15184

Closed
poz opened this issue Oct 23, 2020 · 1 comment
Closed

[BUG]: 'prefix' option does not work for Phalcon\Session\Adapter\Redis #15184

poz opened this issue Oct 23, 2020 · 1 comment
Assignees
Labels
bug A bug report

Comments

@poz
Copy link

poz commented Oct 23, 2020

Describe the bug
In the source documentation: https://github.com/phalcon/cphalcon/blob/v4.0.0/phalcon/Session/Adapter/Redis.zep , it was shown that the options can accept prefix option. However it was hardcoded back into 'sess-reds' in the constructor no matter what was set.

To Reproduce
Steps to reproduce the behavior:

$options = [
    'host'  => '127.0.0.1',
    'port'  => 6379,
    'index' => '0',
    'prefix' => 'custom-prefix-'
];

$session           = new Manager();
$serializerFactory = new SerializerFactory();
$factory           = new AdapterFactory($serializerFactory);
$redis             = new Redis($factory, $options);

$session
    ->setAdapter($redis)
    ->start();

Result of session key in redis:

> KEYS *
sess-reds-h4h1fa8oh5epr3vf4upabbknni
sess-reds-f1tbr5tjsskrj6vtp4uieleva4

Expected behavior
The KEYS in redis session store should be using the custom-prefix-xxxxx instead of default sess-reds

> KEYS *
custom-prefix-h4h1fa8oh5epr3vf4upabbknni
custom-prefix-f1tbr5tjsskrj6vtp4uieleva4

Details

  • Phalcon version: 4.0.6
  • PHP Version: 7.4.7
  • Operating System: Ubuntu 18.04.4 LTS
  • Installation type: via laradock
  • Zephir version (if any):
  • Server: Nginx
  • Other related info (Database, table schema): Redis server v=5.0.7

Additional context
Add any other context about the problem here.

@poz poz added bug A bug report status: unverified Unverified labels Oct 23, 2020
@zsilbi zsilbi added 4.1.0 and removed status: unverified Unverified labels Oct 23, 2020
@zsilbi zsilbi self-assigned this Oct 23, 2020
@zsilbi
Copy link
Member

zsilbi commented Oct 23, 2020

Fixed in #15185

@zsilbi zsilbi closed this as completed Oct 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A bug report
Projects
None yet
Development

No branches or pull requests

2 participants