Skip to content

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 March 8, 2018 12:29
dg added a commit that referenced this pull request Mar 14, 2018
@dg dg closed this in b395717 Mar 14, 2018
dg added a commit that referenced this pull request Mar 14, 2018
dg added a commit that referenced this pull request Mar 14, 2018
dg added a commit that referenced this pull request Mar 14, 2018
dg added a commit that referenced this pull request Mar 14, 2018
@mabar
Copy link
Contributor Author

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 commented Apr 14, 2018

Why not?

@mabar
Copy link
Contributor Author

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants