Skip to content

Commit

Permalink
MDL-81897 tool_mobile: Force partitioned cookies on inapp browser
Browse files Browse the repository at this point in the history
  • Loading branch information
jleyva committed May 14, 2024
1 parent 462d5f0 commit d963e2e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions admin/tool/mobile/launch.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,11 @@
throw new moodle_exception('pluginnotenabledorconfigured', 'tool_mobile');
}

// 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.
Expand Down

0 comments on commit d963e2e

Please sign in to comment.