MDL-81897 tool_mobile: Force partitioned cookies on inapp browser

This commit is contained in:
Juan Leyva
2024-05-17 10:23:24 +02:00
parent f7da739ea0
commit 31b68a2b5d
+5
View File
@@ -69,6 +69,11 @@ if (empty($service)) {
throw new moodle_exception('servicenotavailable', 'webservice');
}
// If the user is using the inapp (embedded) browser, we need to set the Secure and Partitioned attributes to the session cookie.
if (\core_useragent::is_moodle_app()) {
\core\session\utility\cookie_helper::add_attributes_to_cookie_response_header('MoodleSession'.$CFG->sessioncookie, ['Secure', 'Partitioned']);
}
require_login(0, false);
// Require an active user: not guest, not suspended.