Refactored double Set-Cookie prevention code, and session reopening code
This commit is contained in:
parent
91c584ba16
commit
8b6833180d
8 changed files with 30 additions and 22 deletions
13
airtime_mvc/application/common/SessionHelper.php
Normal file
13
airtime_mvc/application/common/SessionHelper.php
Normal file
|
@ -0,0 +1,13 @@
|
|||
<?php
|
||||
|
||||
class SessionHelper
|
||||
{
|
||||
public static function reopenSessionForWriting() {
|
||||
//PHP will send double Set-Cookie headers if we reopen the
|
||||
//session for writing, and this breaks IE8 and some other browsers.
|
||||
//This hacky workaround prevents double headers. Background here:
|
||||
// https://bugs.php.net/bug.php?id=38104
|
||||
ini_set('session.cache_limiter', null);
|
||||
session_start(); // Reopen the session for writing (without resending the Set-Cookie header)
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue