Fix cookie setting.

This commit is contained in:
flash 2018-01-16 08:36:09 +01:00
parent c01f05e2bf
commit 9f0fed9bbf

View file

@ -42,8 +42,8 @@ class AuthController extends Controller
$user->user_chat_key = $_SESSION['chat_key'] = bin2hex(random_bytes(16)); $user->user_chat_key = $_SESSION['chat_key'] = bin2hex(random_bytes(16));
$user->save(); $user->save();
setcookie('msz_tmp_id', $_SESSION['user_id'], time() + 604800, '/'); setcookie('msz_tmp_id', $_SESSION['user_id'], time() + 604800, '/', '.flashii.net');
setcookie('msz_tmp_key', $_SESSION['chat_key'], time() + 604800, '/'); setcookie('msz_tmp_key', $_SESSION['chat_key'], time() + 604800, '/', '.flashii.net');
return ['error' => 'You are now logged in!', 'next' => '/']; return ['error' => 'You are now logged in!', 'next' => '/'];
} }