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

Phalcon\Session\Adapter\Stream wrong open save path #14265

Closed
ZhangRuiMingZRM opened this issue Jul 29, 2019 · 4 comments
Closed

Phalcon\Session\Adapter\Stream wrong open save path #14265

ZhangRuiMingZRM opened this issue Jul 29, 2019 · 4 comments
Assignees
Labels
bug A bug report status: medium Medium

Comments

@ZhangRuiMingZRM
Copy link
Contributor

ZhangRuiMingZRM commented Jul 29, 2019

  • Phalcon version: 4.0.0-beta.1
  • PHP Version: 7.3.6
  • Operating System: ubuntu
  • Installation type: Compiling from source
  • Server: php web server

When running the following code and get this:

 Warning: Phalcon\Session\Adapter\Stream::write(/90192p0avuirodu6r2914kvn9o): failed to open stream: Permission denied in Unknown on line 0
    $session = new Manager();
    $files = new Stream(
        [
            'savePath' => '/tmp',
        ]
    );
    $session->setHandler($files);
    $session->start();

This may be due to the public function open(var savePath, var sessionName) in the phalcon/phalcon/Session/Adapter/Stream.zep

public function open(var savePath, var sessionName) -> bool

    public function open(var savePath, var sessionName) -> bool
    {
        var path;

        if true !== ends_with(savePath, "/") {
            let path = savePath . "/";
        }

        let this->path = path;

        return true;
    }

Previous attributes path are reassigned

@ZhangRuiMingZRM ZhangRuiMingZRM changed the title Phalcon\Session\Adapter\Stream wrong open savePath Phalcon\Session\Adapter\Stream wrong open save path Jul 29, 2019
@sergeyklay sergeyklay added this to the 4.0.0 milestone Jul 29, 2019
This was referenced Aug 3, 2019
@ruudboon ruudboon added the documentation Documentation required label Aug 19, 2019
@ruudboon ruudboon self-assigned this Aug 20, 2019
@beareable
Copy link

what time this bug will be fixed?

@ruudboon
Copy link
Member

ruudboon commented Aug 23, 2019

@beareable Want to fix it before the next release. Bug is fixed in attached pull above. But I'm struggling with the tests. Need to fix that before merging.

@ruudboon ruudboon mentioned this issue Aug 27, 2019
5 tasks
sergeyklay added a commit that referenced this issue Aug 27, 2019
@sergeyklay
Copy link
Contributor

Fixed in the 4.0.x branch. Feel free to open a new issue if the problem appears again. Thank you for the bug report.

@niden niden removed this from the 4.0.0 milestone Dec 15, 2019
@niden niden removed the documentation Documentation required label Dec 15, 2019
@niden niden added bug A bug report status: medium Medium and removed Bug - Medium labels Dec 23, 2019
@bnlambert
Copy link

Hi

I am currently having this same issue on

CentOS Linux 7.8.2003
PHP 7.4.10
Phalcon 7.4

It just suddenly happened no idea on how to fix it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A bug report status: medium Medium
Projects
None yet
Development

No branches or pull requests

6 participants