Skip to content

docs: the session_id acquisition method that is not described #5586

@lf-uraku-yuki

Description

@lf-uraku-yuki

PHP Version

8.0

CodeIgniter4 Version

4.1.7

CodeIgniter4 Installation Method

Composer (using codeigniter4/appstarter)

Which operating systems have you tested for this bug?

Windows

Which server did you use?

cli-server (PHP built-in webserver)

Database

PostgreSQL 11

What happened?

The document only shows how to get session_id by executing session_id() , but since Session::__get('session_id') is always defined, you can get session_id with $session->session_id.

As a merit of describing this method, by mocking the Session class, it is possible to test the processing that depends on the contents of session_id with only the genuine CodeIgniter function.

Steps to Reproduce

Document issue

Expected Output

  1. Publishing in documentation.
  2. add class documents
    @property string session_id

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions