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

Cannot set session cookie parameters for already started session #134

Closed
wants to merge 2 commits into from
Closed

Cannot set session cookie parameters for already started session #134

wants to merge 2 commits into from

Conversation

mabar
Copy link
Contributor

@mabar mabar commented Mar 6, 2018

  • bug fix? yes
  • new feature? no
  • BC break? probably not

Fixes Warning session_set_cookie_params(): Cannot change session cookie parameters when session is active
It happens when Session::setOptions() is called multiple times.
Can be tested with php 7.2+ only. In previous versions it failed silently (see https://bugs.php.net/bug.php?id=75650&thanks=2)

@dg dg force-pushed the master branch 2 times, most recently from 898e948 to b550f69 Compare Mar 8, 2018
dg added a commit that referenced this issue Mar 14, 2018
dg added a commit that referenced this issue Mar 14, 2018
dg added a commit that referenced this issue Mar 14, 2018
dg added a commit that referenced this issue Mar 14, 2018
dg added a commit that referenced this issue Mar 14, 2018
@mabar
Copy link
Contributor Author

@mabar mabar commented Apr 13, 2018

@dg Thanks but nothing changed :(
It makes no sense to call session_name($name) or session_set_cookie_params() twice during one request even if parameters was changed.

@dg
Copy link
Member

@dg dg commented Apr 14, 2018

Why not?

@mabar
Copy link
Contributor Author

@mabar mabar commented Apr 14, 2018

My previous statement is not exact.

  • It makes no sense to call session_name or session_set_cookie_params() after session_start()
    It throws warning everytime in php 7.2 (and fails silently in previous versions).
<?php
error_reporting(E_ALL);
session_start();
session_name('foo');
session_set_cookie_params(0);

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

Successfully merging this pull request may close these issues.

None yet

2 participants