3 <html lang=
"en" class=
"no-js">
7 <meta name=
"viewport" content=
"width=device-width,initial-scale=1">
12 <link rel=
"icon" href=
"../../../assets/default.favicon.ico">
13 <meta name=
"generator" content=
"mkdocs-1.1.2, mkdocs-material-7.1.0">
17 <title>Session Handling and Authentication - WoltLab Suite Documentation
</title>
21 <link rel=
"stylesheet" href=
"../../../assets/stylesheets/main.33e2939f.min.css">
24 <link rel=
"stylesheet" href=
"../../../assets/stylesheets/palette.ef6f36e2.min.css">
28 <meta name=
"theme-color" content=
"#009485">
38 <link rel=
"stylesheet" href=
"../../../stylesheets/extra.css">
52 <body dir=
"ltr" data-md-color-scheme=
"" data-md-color-primary=
"teal" data-md-color-accent=
"">
55 <script>function __prefix(e){return new URL(
"../../..",location).pathname+
"."+e}function __get(e,t=localStorage){return JSON.parse(t.getItem(__prefix(e)))}
</script>
57 <input class=
"md-toggle" data-md-toggle=
"drawer" type=
"checkbox" id=
"__drawer" autocomplete=
"off">
58 <input class=
"md-toggle" data-md-toggle=
"search" type=
"checkbox" id=
"__search" autocomplete=
"off">
59 <label class=
"md-overlay" for=
"__drawer"></label>
60 <div data-md-component=
"skip">
63 <a href=
"#migrating-from-wsc-53-session-handling-and-authentication" class=
"md-skip">
68 <div data-md-component=
"announce">
70 <aside class=
"md-announce">
71 <div class=
"md-announce__inner md-grid md-typeset">
73 <a href=
"https://www.woltlab.com">Back to
<strong>woltlab.com
</strong></a>
80 <header class=
"md-header" data-md-component=
"header">
81 <nav class=
"md-header__inner md-grid" aria-label=
"Header">
82 <a href=
"../../.." title=
"WoltLab Suite Documentation" class=
"md-header__button md-logo" aria-label=
"WoltLab Suite Documentation" data-md-component=
"logo">
84 <img src=
"../../../assets/logo.png" alt=
"logo">
87 <label class=
"md-header__button md-icon" for=
"__drawer">
88 <svg xmlns=
"http://www.w3.org/2000/svg" viewBox=
"0 0 24 24"><path d=
"M3 6h18v2H3V6m0 5h18v2H3v-2m0 5h18v2H3v-2z"/></svg>
90 <div class=
"md-header__title" data-md-component=
"header-title">
91 <div class=
"md-header__ellipsis">
92 <div class=
"md-header__topic">
93 <span class=
"md-ellipsis">
94 WoltLab Suite Documentation
97 <div class=
"md-header__topic" data-md-component=
"header-topic">
98 <span class=
"md-ellipsis">
100 Session Handling and Authentication
109 <label class=
"md-header__button md-icon" for=
"__search">
110 <svg xmlns=
"http://www.w3.org/2000/svg" viewBox=
"0 0 24 24"><path d=
"M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.516 6.516 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5z"/></svg>
113 <div class=
"md-search" data-md-component=
"search" role=
"dialog">
114 <label class=
"md-search__overlay" for=
"__search"></label>
115 <div class=
"md-search__inner" role=
"search">
116 <form class=
"md-search__form" name=
"search">
117 <input type=
"text" class=
"md-search__input" name=
"query" aria-label=
"Search" placeholder=
"Search" autocapitalize=
"off" autocorrect=
"off" autocomplete=
"off" spellcheck=
"false" data-md-component=
"search-query" data-md-state=
"active" required
>
118 <label class=
"md-search__icon md-icon" for=
"__search">
119 <svg xmlns=
"http://www.w3.org/2000/svg" viewBox=
"0 0 24 24"><path d=
"M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.516 6.516 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5z"/></svg>
120 <svg xmlns=
"http://www.w3.org/2000/svg" viewBox=
"0 0 24 24"><path d=
"M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12z"/></svg>
122 <button type=
"reset" class=
"md-search__icon md-icon" aria-label=
"Clear" tabindex=
"-1">
123 <svg xmlns=
"http://www.w3.org/2000/svg" viewBox=
"0 0 24 24"><path d=
"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"/></svg>
126 <div class=
"md-search__output">
127 <div class=
"md-search__scrollwrap" data-md-scrollfix
>
128 <div class=
"md-search-result" data-md-component=
"search-result">
129 <div class=
"md-search-result__meta">
132 <ol class=
"md-search-result__list"></ol>
140 <div class=
"md-header__source">
142 <a href=
"https://github.com/WoltLab/docs.woltlab.com/" title=
"Go to repository" class=
"md-source" data-md-component=
"source">
143 <div class=
"md-source__icon md-icon">
145 <svg xmlns=
"http://www.w3.org/2000/svg" viewBox=
"0 0 448 512"><path d=
"M439.55 236.05 244 40.45a28.87 28.87 0 0 0-40.81 0l-40.66 40.63 51.52 51.52c27.06-9.14 52.68 16.77 43.39 43.68l49.66 49.66c34.23-11.8 61.18 31 35.47 56.69-26.49 26.49-70.21-2.87-56-37.34L240.22 199v121.85c25.3 12.54 22.26 41.85 9.08 55a34.34 34.34 0 0 1-48.55 0c-17.57-17.6-11.07-46.91 11.25-56v-123c-20.8-8.51-24.6-30.74-18.64-45L142.57 101 8.45 235.14a28.86 28.86 0 0 0 0 40.81l195.61 195.6a28.86 28.86 0 0 0 40.8 0l194.69-194.69a28.86 28.86 0 0 0 0-40.81z"/></svg>
147 <div class=
"md-source__repository">
156 <div class=
"md-container" data-md-component=
"container">
161 <main class=
"md-main" data-md-component=
"main">
162 <div class=
"md-main__inner md-grid">
166 <div class=
"md-sidebar md-sidebar--primary" data-md-component=
"sidebar" data-md-type=
"navigation" >
167 <div class=
"md-sidebar__scrollwrap">
168 <div class=
"md-sidebar__inner">
172 <nav class=
"md-nav md-nav--primary" aria-label=
"Navigation" data-md-level=
"0">
173 <label class=
"md-nav__title" for=
"__drawer">
174 <a href=
"../../.." title=
"WoltLab Suite Documentation" class=
"md-nav__button md-logo" aria-label=
"WoltLab Suite Documentation" data-md-component=
"logo">
176 <img src=
"../../../assets/logo.png" alt=
"logo">
179 WoltLab Suite Documentation
182 <div class=
"md-nav__source">
184 <a href=
"https://github.com/WoltLab/docs.woltlab.com/" title=
"Go to repository" class=
"md-source" data-md-component=
"source">
185 <div class=
"md-source__icon md-icon">
187 <svg xmlns=
"http://www.w3.org/2000/svg" viewBox=
"0 0 448 512"><path d=
"M439.55 236.05 244 40.45a28.87 28.87 0 0 0-40.81 0l-40.66 40.63 51.52 51.52c27.06-9.14 52.68 16.77 43.39 43.68l49.66 49.66c34.23-11.8 61.18 31 35.47 56.69-26.49 26.49-70.21-2.87-56-37.34L240.22 199v121.85c25.3 12.54 22.26 41.85 9.08 55a34.34 34.34 0 0 1-48.55 0c-17.57-17.6-11.07-46.91 11.25-56v-123c-20.8-8.51-24.6-30.74-18.64-45L142.57 101 8.45 235.14a28.86 28.86 0 0 0 0 40.81l195.61 195.6a28.86 28.86 0 0 0 40.8 0l194.69-194.69a28.86 28.86 0 0 0 0-40.81z"/></svg>
189 <div class=
"md-source__repository">
195 <ul class=
"md-nav__list" data-md-scrollfix
>
204 <li class=
"md-nav__item">
205 <a href=
"../../../getting-started/" class=
"md-nav__link">
220 <li class=
"md-nav__item md-nav__item--nested">
223 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_2" type=
"checkbox" id=
"__nav_2" >
225 <label class=
"md-nav__link" for=
"__nav_2">
227 <span class=
"md-nav__icon md-icon"></span>
229 <nav class=
"md-nav" aria-label=
"PHP API" data-md-level=
"1">
230 <label class=
"md-nav__title" for=
"__nav_2">
231 <span class=
"md-nav__icon md-icon"></span>
234 <ul class=
"md-nav__list" data-md-scrollfix
>
240 <li class=
"md-nav__item">
241 <a href=
"../../../php/pages/" class=
"md-nav__link">
252 <li class=
"md-nav__item">
253 <a href=
"../../../php/database-objects/" class=
"md-nav__link">
264 <li class=
"md-nav__item">
265 <a href=
"../../../php/database-access/" class=
"md-nav__link">
276 <li class=
"md-nav__item">
277 <a href=
"../../../php/exceptions/" class=
"md-nav__link">
289 <li class=
"md-nav__item md-nav__item--nested">
292 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_2_5" type=
"checkbox" id=
"__nav_2_5" >
294 <label class=
"md-nav__link" for=
"__nav_2_5">
296 <span class=
"md-nav__icon md-icon"></span>
298 <nav class=
"md-nav" aria-label=
"API" data-md-level=
"2">
299 <label class=
"md-nav__title" for=
"__nav_2_5">
300 <span class=
"md-nav__icon md-icon"></span>
303 <ul class=
"md-nav__list" data-md-scrollfix
>
309 <li class=
"md-nav__item">
310 <a href=
"../../../php/api/caches/" class=
"md-nav__link">
321 <li class=
"md-nav__item">
322 <a href=
"../../../php/api/comments/" class=
"md-nav__link">
333 <li class=
"md-nav__item">
334 <a href=
"../../../php/api/cronjobs/" class=
"md-nav__link">
345 <li class=
"md-nav__item">
346 <a href=
"../../../php/api/events/" class=
"md-nav__link">
358 <li class=
"md-nav__item md-nav__item--nested">
361 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_2_5_5" type=
"checkbox" id=
"__nav_2_5_5" >
363 <label class=
"md-nav__link" for=
"__nav_2_5_5">
365 <span class=
"md-nav__icon md-icon"></span>
367 <nav class=
"md-nav" aria-label=
"Form Builder" data-md-level=
"3">
368 <label class=
"md-nav__title" for=
"__nav_2_5_5">
369 <span class=
"md-nav__icon md-icon"></span>
372 <ul class=
"md-nav__list" data-md-scrollfix
>
378 <li class=
"md-nav__item">
379 <a href=
"../../../php/api/form_builder/overview/" class=
"md-nav__link">
390 <li class=
"md-nav__item">
391 <a href=
"../../../php/api/form_builder/structure/" class=
"md-nav__link">
402 <li class=
"md-nav__item">
403 <a href=
"../../../php/api/form_builder/form_fields/" class=
"md-nav__link">
414 <li class=
"md-nav__item">
415 <a href=
"../../../php/api/form_builder/validation_data/" class=
"md-nav__link">
426 <li class=
"md-nav__item">
427 <a href=
"../../../php/api/form_builder/dependencies/" class=
"md-nav__link">
444 <li class=
"md-nav__item">
445 <a href=
"../../../php/api/package_installation_plugins/" class=
"md-nav__link">
446 Package Installation Plugins
456 <li class=
"md-nav__item">
457 <a href=
"../../../php/api/user_activity_points/" class=
"md-nav__link">
468 <li class=
"md-nav__item">
469 <a href=
"../../../php/api/user_notifications/" class=
"md-nav__link">
480 <li class=
"md-nav__item">
481 <a href=
"../../../php/api/sitemaps/" class=
"md-nav__link">
498 <li class=
"md-nav__item">
499 <a href=
"../../../php/code-style/" class=
"md-nav__link">
510 <li class=
"md-nav__item">
511 <a href=
"../../../php/apps/" class=
"md-nav__link">
522 <li class=
"md-nav__item">
523 <a href=
"../../../php/gdpr/" class=
"md-nav__link">
544 <li class=
"md-nav__item md-nav__item--nested">
547 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_3" type=
"checkbox" id=
"__nav_3" >
549 <label class=
"md-nav__link" for=
"__nav_3">
550 Languages, Templates & CSS
551 <span class=
"md-nav__icon md-icon"></span>
553 <nav class=
"md-nav" aria-label=
"Languages, Templates & CSS" data-md-level=
"1">
554 <label class=
"md-nav__title" for=
"__nav_3">
555 <span class=
"md-nav__icon md-icon"></span>
556 Languages, Templates & CSS
558 <ul class=
"md-nav__list" data-md-scrollfix
>
564 <li class=
"md-nav__item">
565 <a href=
"../../../view/languages/" class=
"md-nav__link">
576 <li class=
"md-nav__item">
577 <a href=
"../../../view/templates/" class=
"md-nav__link">
588 <li class=
"md-nav__item">
589 <a href=
"../../../view/css/" class=
"md-nav__link">
610 <li class=
"md-nav__item md-nav__item--nested">
613 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_4" type=
"checkbox" id=
"__nav_4" >
615 <label class=
"md-nav__link" for=
"__nav_4">
617 <span class=
"md-nav__icon md-icon"></span>
619 <nav class=
"md-nav" aria-label=
"JavaScript API" data-md-level=
"1">
620 <label class=
"md-nav__title" for=
"__nav_4">
621 <span class=
"md-nav__icon md-icon"></span>
624 <ul class=
"md-nav__list" data-md-scrollfix
>
630 <li class=
"md-nav__item">
631 <a href=
"../../../javascript/general-usage/" class=
"md-nav__link">
643 <li class=
"md-nav__item md-nav__item--nested">
646 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_4_2" type=
"checkbox" id=
"__nav_4_2" >
648 <label class=
"md-nav__link" for=
"__nav_4_2">
650 <span class=
"md-nav__icon md-icon"></span>
652 <nav class=
"md-nav" aria-label=
"New API" data-md-level=
"2">
653 <label class=
"md-nav__title" for=
"__nav_4_2">
654 <span class=
"md-nav__icon md-icon"></span>
657 <ul class=
"md-nav__list" data-md-scrollfix
>
663 <li class=
"md-nav__item">
664 <a href=
"../../../javascript/new-api_writing-a-module/" class=
"md-nav__link">
675 <li class=
"md-nav__item">
676 <a href=
"../../../javascript/new-api_data-structures/" class=
"md-nav__link">
687 <li class=
"md-nav__item">
688 <a href=
"../../../javascript/new-api_core/" class=
"md-nav__link">
699 <li class=
"md-nav__item">
700 <a href=
"../../../javascript/new-api_dom/" class=
"md-nav__link">
711 <li class=
"md-nav__item">
712 <a href=
"../../../javascript/new-api_events/" class=
"md-nav__link">
723 <li class=
"md-nav__item">
724 <a href=
"../../../javascript/new-api_ajax/" class=
"md-nav__link">
735 <li class=
"md-nav__item">
736 <a href=
"../../../javascript/new-api_dialogs/" class=
"md-nav__link">
747 <li class=
"md-nav__item">
748 <a href=
"../../../javascript/new-api_browser/" class=
"md-nav__link">
749 Browser and Screen Sizes
759 <li class=
"md-nav__item">
760 <a href=
"../../../javascript/new-api_ui/" class=
"md-nav__link">
777 <li class=
"md-nav__item">
778 <a href=
"../../../javascript/legacy-api/" class=
"md-nav__link">
789 <li class=
"md-nav__item">
790 <a href=
"../../../javascript/helper-functions/" class=
"md-nav__link">
801 <li class=
"md-nav__item">
802 <a href=
"../../../javascript/code-snippets/" class=
"md-nav__link">
823 <li class=
"md-nav__item md-nav__item--nested">
826 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_5" type=
"checkbox" id=
"__nav_5" >
828 <label class=
"md-nav__link" for=
"__nav_5">
830 <span class=
"md-nav__icon md-icon"></span>
832 <nav class=
"md-nav" aria-label=
"Package Components" data-md-level=
"1">
833 <label class=
"md-nav__title" for=
"__nav_5">
834 <span class=
"md-nav__icon md-icon"></span>
837 <ul class=
"md-nav__list" data-md-scrollfix
>
843 <li class=
"md-nav__item">
844 <a href=
"../../../package/package-xml/" class=
"md-nav__link">
856 <li class=
"md-nav__item md-nav__item--nested">
859 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_5_2" type=
"checkbox" id=
"__nav_5_2" >
861 <label class=
"md-nav__link" for=
"__nav_5_2">
863 <span class=
"md-nav__icon md-icon"></span>
865 <nav class=
"md-nav" aria-label=
"PIPs" data-md-level=
"2">
866 <label class=
"md-nav__title" for=
"__nav_5_2">
867 <span class=
"md-nav__icon md-icon"></span>
870 <ul class=
"md-nav__list" data-md-scrollfix
>
876 <li class=
"md-nav__item">
877 <a href=
"../../../package/pip/" class=
"md-nav__link">
888 <li class=
"md-nav__item">
889 <a href=
"../../../package/pip/acl-option/" class=
"md-nav__link">
900 <li class=
"md-nav__item">
901 <a href=
"../../../package/pip/acp-menu/" class=
"md-nav__link">
912 <li class=
"md-nav__item">
913 <a href=
"../../../package/pip/acp-search-provider/" class=
"md-nav__link">
924 <li class=
"md-nav__item">
925 <a href=
"../../../package/pip/acp-template/" class=
"md-nav__link">
936 <li class=
"md-nav__item">
937 <a href=
"../../../package/pip/bbcode/" class=
"md-nav__link">
948 <li class=
"md-nav__item">
949 <a href=
"../../../package/pip/box/" class=
"md-nav__link">
960 <li class=
"md-nav__item">
961 <a href=
"../../../package/pip/clipboard-action/" class=
"md-nav__link">
972 <li class=
"md-nav__item">
973 <a href=
"../../../package/pip/core-object/" class=
"md-nav__link">
984 <li class=
"md-nav__item">
985 <a href=
"../../../package/pip/cronjob/" class=
"md-nav__link">
996 <li class=
"md-nav__item">
997 <a href=
"../../../package/pip/event-listener/" class=
"md-nav__link">
1008 <li class=
"md-nav__item">
1009 <a href=
"../../../package/pip/file/" class=
"md-nav__link">
1020 <li class=
"md-nav__item">
1021 <a href=
"../../../package/pip/language/" class=
"md-nav__link">
1032 <li class=
"md-nav__item">
1033 <a href=
"../../../package/pip/media-provider/" class=
"md-nav__link">
1044 <li class=
"md-nav__item">
1045 <a href=
"../../../package/pip/menu/" class=
"md-nav__link">
1056 <li class=
"md-nav__item">
1057 <a href=
"../../../package/pip/menu-item/" class=
"md-nav__link">
1068 <li class=
"md-nav__item">
1069 <a href=
"../../../package/pip/object-type/" class=
"md-nav__link">
1080 <li class=
"md-nav__item">
1081 <a href=
"../../../package/pip/object-type-definition/" class=
"md-nav__link">
1082 objectTypeDefinition
1092 <li class=
"md-nav__item">
1093 <a href=
"../../../package/pip/option/" class=
"md-nav__link">
1104 <li class=
"md-nav__item">
1105 <a href=
"../../../package/pip/page/" class=
"md-nav__link">
1116 <li class=
"md-nav__item">
1117 <a href=
"../../../package/pip/pip/" class=
"md-nav__link">
1128 <li class=
"md-nav__item">
1129 <a href=
"../../../package/pip/script/" class=
"md-nav__link">
1140 <li class=
"md-nav__item">
1141 <a href=
"../../../package/pip/smiley/" class=
"md-nav__link">
1152 <li class=
"md-nav__item">
1153 <a href=
"../../../package/pip/sql/" class=
"md-nav__link">
1164 <li class=
"md-nav__item">
1165 <a href=
"../../../package/pip/style/" class=
"md-nav__link">
1176 <li class=
"md-nav__item">
1177 <a href=
"../../../package/pip/template/" class=
"md-nav__link">
1188 <li class=
"md-nav__item">
1189 <a href=
"../../../package/pip/template-listener/" class=
"md-nav__link">
1200 <li class=
"md-nav__item">
1201 <a href=
"../../../package/pip/user-group-option/" class=
"md-nav__link">
1212 <li class=
"md-nav__item">
1213 <a href=
"../../../package/pip/user-menu/" class=
"md-nav__link">
1224 <li class=
"md-nav__item">
1225 <a href=
"../../../package/pip/user-notification-event/" class=
"md-nav__link">
1226 userNotificationEvent
1236 <li class=
"md-nav__item">
1237 <a href=
"../../../package/pip/user-option/" class=
"md-nav__link">
1248 <li class=
"md-nav__item">
1249 <a href=
"../../../package/pip/user-profile-menu/" class=
"md-nav__link">
1266 <li class=
"md-nav__item">
1267 <a href=
"../../../package/database-php-api/" class=
"md-nav__link">
1290 <li class=
"md-nav__item md-nav__item--active md-nav__item--nested">
1293 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_6" type=
"checkbox" id=
"__nav_6" checked
>
1295 <label class=
"md-nav__link" for=
"__nav_6">
1297 <span class=
"md-nav__icon md-icon"></span>
1299 <nav class=
"md-nav" aria-label=
"Migration" data-md-level=
"1">
1300 <label class=
"md-nav__title" for=
"__nav_6">
1301 <span class=
"md-nav__icon md-icon"></span>
1304 <ul class=
"md-nav__list" data-md-scrollfix
>
1313 <li class=
"md-nav__item md-nav__item--active md-nav__item--nested">
1316 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_6_1" type=
"checkbox" id=
"__nav_6_1" checked
>
1318 <label class=
"md-nav__link" for=
"__nav_6_1">
1319 Migrating from WSC
5.3
1320 <span class=
"md-nav__icon md-icon"></span>
1322 <nav class=
"md-nav" aria-label=
"Migrating from WSC 5.3" data-md-level=
"2">
1323 <label class=
"md-nav__title" for=
"__nav_6_1">
1324 <span class=
"md-nav__icon md-icon"></span>
1325 Migrating from WSC
5.3
1327 <ul class=
"md-nav__list" data-md-scrollfix
>
1333 <li class=
"md-nav__item">
1334 <a href=
"../php/" class=
"md-nav__link">
1347 <li class=
"md-nav__item md-nav__item--active">
1349 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"toc" type=
"checkbox" id=
"__toc">
1354 <label class=
"md-nav__link md-nav__link--active" for=
"__toc">
1355 Session Handling and Authentication
1356 <span class=
"md-nav__icon md-icon"></span>
1359 <a href=
"./" class=
"md-nav__link md-nav__link--active">
1360 Session Handling and Authentication
1364 <nav class=
"md-nav md-nav--secondary" aria-label=
"Table of contents">
1370 <label class=
"md-nav__title" for=
"__toc">
1371 <span class=
"md-nav__icon md-icon"></span>
1374 <ul class=
"md-nav__list" data-md-component=
"toc" data-md-scrollfix
>
1376 <li class=
"md-nav__item">
1377 <a href=
"#summary-and-concepts" class=
"md-nav__link">
1378 Summary and Concepts
1381 <nav class=
"md-nav" aria-label=
"Summary and Concepts">
1382 <ul class=
"md-nav__list">
1384 <li class=
"md-nav__item">
1385 <a href=
"#legacy-persistent-login" class=
"md-nav__link">
1386 Legacy Persistent Login
1391 <li class=
"md-nav__item">
1392 <a href=
"#multiple-sessions" class=
"md-nav__link">
1398 <li class=
"md-nav__item">
1399 <a href=
"#merged-acp-and-frontend-sessions" class=
"md-nav__link">
1400 Merged ACP and Frontend Sessions
1405 <li class=
"md-nav__item">
1406 <a href=
"#improved-authentication-and-reauthentication" class=
"md-nav__link">
1407 Improved Authentication and Reauthentication
1417 <li class=
"md-nav__item">
1418 <a href=
"#additions-and-changes" class=
"md-nav__link">
1419 Additions and Changes
1422 <nav class=
"md-nav" aria-label=
"Additions and Changes">
1423 <ul class=
"md-nav__list">
1425 <li class=
"md-nav__item">
1426 <a href=
"#password-hashing" class=
"md-nav__link">
1432 <li class=
"md-nav__item">
1433 <a href=
"#session-storage" class=
"md-nav__link">
1439 <li class=
"md-nav__item">
1440 <a href=
"#reauthentication" class=
"md-nav__link">
1446 <li class=
"md-nav__item">
1447 <a href=
"#multi-factor-authentication" class=
"md-nav__link">
1448 Multi-factor Authentication
1451 <nav class=
"md-nav" aria-label=
"Multi-factor Authentication">
1452 <ul class=
"md-nav__list">
1454 <li class=
"md-nav__item">
1455 <a href=
"#adding-multi-factor-methods" class=
"md-nav__link">
1456 Adding Multi-factor Methods
1471 <li class=
"md-nav__item">
1472 <a href=
"#deprecations-and-removals" class=
"md-nav__link">
1473 Deprecations and Removals
1476 <nav class=
"md-nav" aria-label=
"Deprecations and Removals">
1477 <ul class=
"md-nav__list">
1479 <li class=
"md-nav__item">
1480 <a href=
"#sessionhandler" class=
"md-nav__link">
1486 <li class=
"md-nav__item">
1487 <a href=
"#acp-sessions" class=
"md-nav__link">
1493 <li class=
"md-nav__item">
1494 <a href=
"#cookies" class=
"md-nav__link">
1500 <li class=
"md-nav__item">
1501 <a href=
"#virtual-sessions" class=
"md-nav__link">
1507 <li class=
"md-nav__item">
1508 <a href=
"#security-token-constants" class=
"md-nav__link">
1509 Security Token Constants
1514 <li class=
"md-nav__item">
1515 <a href=
"#passwordutil-and-double-bcrypt-hashes" class=
"md-nav__link">
1516 PasswordUtil and Double BCrypt Hashes
1538 <li class=
"md-nav__item">
1539 <a href=
"../javascript/" class=
"md-nav__link">
1550 <li class=
"md-nav__item">
1551 <a href=
"../templates/" class=
"md-nav__link">
1562 <li class=
"md-nav__item">
1563 <a href=
"../libraries/" class=
"md-nav__link">
1564 Third Party Libraries
1581 <li class=
"md-nav__item md-nav__item--nested">
1584 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_6_2" type=
"checkbox" id=
"__nav_6_2" >
1586 <label class=
"md-nav__link" for=
"__nav_6_2">
1587 Migrating from WSC
5.2
1588 <span class=
"md-nav__icon md-icon"></span>
1590 <nav class=
"md-nav" aria-label=
"Migrating from WSC 5.2" data-md-level=
"2">
1591 <label class=
"md-nav__title" for=
"__nav_6_2">
1592 <span class=
"md-nav__icon md-icon"></span>
1593 Migrating from WSC
5.2
1595 <ul class=
"md-nav__list" data-md-scrollfix
>
1601 <li class=
"md-nav__item">
1602 <a href=
"../../wsc52/php/" class=
"md-nav__link">
1613 <li class=
"md-nav__item">
1614 <a href=
"../../wsc52/templates/" class=
"md-nav__link">
1615 Templates and Languages
1625 <li class=
"md-nav__item">
1626 <a href=
"../../wsc52/libraries/" class=
"md-nav__link">
1627 Third Party Libraries
1644 <li class=
"md-nav__item md-nav__item--nested">
1647 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_6_3" type=
"checkbox" id=
"__nav_6_3" >
1649 <label class=
"md-nav__link" for=
"__nav_6_3">
1650 Migrating from WSC
3.1
1651 <span class=
"md-nav__icon md-icon"></span>
1653 <nav class=
"md-nav" aria-label=
"Migrating from WSC 3.1" data-md-level=
"2">
1654 <label class=
"md-nav__title" for=
"__nav_6_3">
1655 <span class=
"md-nav__icon md-icon"></span>
1656 Migrating from WSC
3.1
1658 <ul class=
"md-nav__list" data-md-scrollfix
>
1664 <li class=
"md-nav__item">
1665 <a href=
"../../wsc31/php/" class=
"md-nav__link">
1683 <li class=
"md-nav__item md-nav__item--nested">
1686 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_6_4" type=
"checkbox" id=
"__nav_6_4" >
1688 <label class=
"md-nav__link" for=
"__nav_6_4">
1689 Migrating from WSC
3.0
1690 <span class=
"md-nav__icon md-icon"></span>
1692 <nav class=
"md-nav" aria-label=
"Migrating from WSC 3.0" data-md-level=
"2">
1693 <label class=
"md-nav__title" for=
"__nav_6_4">
1694 <span class=
"md-nav__icon md-icon"></span>
1695 Migrating from WSC
3.0
1697 <ul class=
"md-nav__list" data-md-scrollfix
>
1703 <li class=
"md-nav__item">
1704 <a href=
"../../wsc30/php/" class=
"md-nav__link">
1715 <li class=
"md-nav__item">
1716 <a href=
"../../wsc30/javascript/" class=
"md-nav__link">
1727 <li class=
"md-nav__item">
1728 <a href=
"../../wsc30/templates/" class=
"md-nav__link">
1739 <li class=
"md-nav__item">
1740 <a href=
"../../wsc30/css/" class=
"md-nav__link">
1751 <li class=
"md-nav__item">
1752 <a href=
"../../wsc30/package/" class=
"md-nav__link">
1770 <li class=
"md-nav__item md-nav__item--nested">
1773 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_6_5" type=
"checkbox" id=
"__nav_6_5" >
1775 <label class=
"md-nav__link" for=
"__nav_6_5">
1776 Migrating from WCF
2.1
1777 <span class=
"md-nav__icon md-icon"></span>
1779 <nav class=
"md-nav" aria-label=
"Migrating from WCF 2.1" data-md-level=
"2">
1780 <label class=
"md-nav__title" for=
"__nav_6_5">
1781 <span class=
"md-nav__icon md-icon"></span>
1782 Migrating from WCF
2.1
1784 <ul class=
"md-nav__list" data-md-scrollfix
>
1790 <li class=
"md-nav__item">
1791 <a href=
"../../wcf21/php/" class=
"md-nav__link">
1802 <li class=
"md-nav__item">
1803 <a href=
"../../wcf21/templates/" class=
"md-nav__link">
1814 <li class=
"md-nav__item">
1815 <a href=
"../../wcf21/css/" class=
"md-nav__link">
1826 <li class=
"md-nav__item">
1827 <a href=
"../../wcf21/package/" class=
"md-nav__link">
1854 <li class=
"md-nav__item md-nav__item--nested">
1857 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_7" type=
"checkbox" id=
"__nav_7" >
1859 <label class=
"md-nav__link" for=
"__nav_7">
1861 <span class=
"md-nav__icon md-icon"></span>
1863 <nav class=
"md-nav" aria-label=
"Tutorials" data-md-level=
"1">
1864 <label class=
"md-nav__title" for=
"__nav_7">
1865 <span class=
"md-nav__icon md-icon"></span>
1868 <ul class=
"md-nav__list" data-md-scrollfix
>
1875 <li class=
"md-nav__item md-nav__item--nested">
1878 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_7_1" type=
"checkbox" id=
"__nav_7_1" >
1880 <label class=
"md-nav__link" for=
"__nav_7_1">
1882 <span class=
"md-nav__icon md-icon"></span>
1884 <nav class=
"md-nav" aria-label=
"Tutorial Series" data-md-level=
"2">
1885 <label class=
"md-nav__title" for=
"__nav_7_1">
1886 <span class=
"md-nav__icon md-icon"></span>
1889 <ul class=
"md-nav__list" data-md-scrollfix
>
1895 <li class=
"md-nav__item">
1896 <a href=
"../../../tutorial/series/overview/" class=
"md-nav__link">
1907 <li class=
"md-nav__item">
1908 <a href=
"../../../tutorial/series/part_1/" class=
"md-nav__link">
1919 <li class=
"md-nav__item">
1920 <a href=
"../../../tutorial/series/part_2/" class=
"md-nav__link">
1931 <li class=
"md-nav__item">
1932 <a href=
"../../../tutorial/series/part_3/" class=
"md-nav__link">
1959 <div class=
"md-sidebar md-sidebar--secondary" data-md-component=
"sidebar" data-md-type=
"toc" >
1960 <div class=
"md-sidebar__scrollwrap">
1961 <div class=
"md-sidebar__inner">
1963 <nav class=
"md-nav md-nav--secondary" aria-label=
"Table of contents">
1969 <label class=
"md-nav__title" for=
"__toc">
1970 <span class=
"md-nav__icon md-icon"></span>
1973 <ul class=
"md-nav__list" data-md-component=
"toc" data-md-scrollfix
>
1975 <li class=
"md-nav__item">
1976 <a href=
"#summary-and-concepts" class=
"md-nav__link">
1977 Summary and Concepts
1980 <nav class=
"md-nav" aria-label=
"Summary and Concepts">
1981 <ul class=
"md-nav__list">
1983 <li class=
"md-nav__item">
1984 <a href=
"#legacy-persistent-login" class=
"md-nav__link">
1985 Legacy Persistent Login
1990 <li class=
"md-nav__item">
1991 <a href=
"#multiple-sessions" class=
"md-nav__link">
1997 <li class=
"md-nav__item">
1998 <a href=
"#merged-acp-and-frontend-sessions" class=
"md-nav__link">
1999 Merged ACP and Frontend Sessions
2004 <li class=
"md-nav__item">
2005 <a href=
"#improved-authentication-and-reauthentication" class=
"md-nav__link">
2006 Improved Authentication and Reauthentication
2016 <li class=
"md-nav__item">
2017 <a href=
"#additions-and-changes" class=
"md-nav__link">
2018 Additions and Changes
2021 <nav class=
"md-nav" aria-label=
"Additions and Changes">
2022 <ul class=
"md-nav__list">
2024 <li class=
"md-nav__item">
2025 <a href=
"#password-hashing" class=
"md-nav__link">
2031 <li class=
"md-nav__item">
2032 <a href=
"#session-storage" class=
"md-nav__link">
2038 <li class=
"md-nav__item">
2039 <a href=
"#reauthentication" class=
"md-nav__link">
2045 <li class=
"md-nav__item">
2046 <a href=
"#multi-factor-authentication" class=
"md-nav__link">
2047 Multi-factor Authentication
2050 <nav class=
"md-nav" aria-label=
"Multi-factor Authentication">
2051 <ul class=
"md-nav__list">
2053 <li class=
"md-nav__item">
2054 <a href=
"#adding-multi-factor-methods" class=
"md-nav__link">
2055 Adding Multi-factor Methods
2070 <li class=
"md-nav__item">
2071 <a href=
"#deprecations-and-removals" class=
"md-nav__link">
2072 Deprecations and Removals
2075 <nav class=
"md-nav" aria-label=
"Deprecations and Removals">
2076 <ul class=
"md-nav__list">
2078 <li class=
"md-nav__item">
2079 <a href=
"#sessionhandler" class=
"md-nav__link">
2085 <li class=
"md-nav__item">
2086 <a href=
"#acp-sessions" class=
"md-nav__link">
2092 <li class=
"md-nav__item">
2093 <a href=
"#cookies" class=
"md-nav__link">
2099 <li class=
"md-nav__item">
2100 <a href=
"#virtual-sessions" class=
"md-nav__link">
2106 <li class=
"md-nav__item">
2107 <a href=
"#security-token-constants" class=
"md-nav__link">
2108 Security Token Constants
2113 <li class=
"md-nav__item">
2114 <a href=
"#passwordutil-and-double-bcrypt-hashes" class=
"md-nav__link">
2115 PasswordUtil and Double BCrypt Hashes
2133 <div class=
"md-content" data-md-component=
"content">
2134 <article class=
"md-content__inner md-typeset">
2137 <a href=
"https://github.com/WoltLab/docs.woltlab.com/edit/5.4/docs/migration/wsc53/session.md" title=
"Edit this page" class=
"md-content__button md-icon">
2138 <svg xmlns=
"http://www.w3.org/2000/svg" viewBox=
"0 0 24 24"><path d=
"M20.71 7.04c.39-.39.39-1.04 0-1.41l-2.34-2.34c-.37-.39-1.02-.39-1.41 0l-1.84 1.83 3.75 3.75M3 17.25V21h3.75L17.81 9.93l-3.75-3.75L3 17.25z"/></svg>
2142 <h1 id=
"migrating-from-wsc-53-session-handling-and-authentication">Migrating from WSC
5.3 - Session Handling and Authentication
<a class=
"headerlink" href=
"#migrating-from-wsc-53-session-handling-and-authentication" title=
"Permanent link">#
</a></h1>
2143 <p>WoltLab Suite
5.4 includes a completely refactored session handling.
2144 As long as you only interact with sessions via
<code>WCF::getSession()
</code>, especially when you perform read-only accesses, you should not notice any breaking changes.
</p>
2145 <p>You might appreciate some of the new session methods if you process security sensitive data.
</p>
2146 <h2 id=
"summary-and-concepts">Summary and Concepts
<a class=
"headerlink" href=
"#summary-and-concepts" title=
"Permanent link">#
</a></h2>
2147 <p>Most of the changes revolve around the removal of the legacy persistent login functionality and the assumption that every user has a single session only.
2148 Both aspects are related to each other.
</p>
2149 <h3 id=
"legacy-persistent-login">Legacy Persistent Login
<a class=
"headerlink" href=
"#legacy-persistent-login" title=
"Permanent link">#
</a></h3>
2150 <p>The legacy persistent login was rather an automated login.
2151 Upon bootstrapping a session, it was checked whether the user had a cookie pair storing the user’s
<code>userID
</code> and (a single BCrypt hash of) the user’s password.
2152 If such a cookie pair exists and the BCrypt hash within the cookie matches the user’s password hash when hashed again, the session would immediately
<code>changeUser()
</code> to the respective user.
</p>
2153 <p>This legacy persistent login was completely removed.
2154 Instead, any sessions that belong to an authenticated user will automatically be long-lived.
2155 These long-lived sessions expire no sooner than
14 days after the last activity, ensuring that the user continously stays logged in, provided that they visit the page at least once per fortnight.
</p>
2156 <h3 id=
"multiple-sessions">Multiple Sessions
<a class=
"headerlink" href=
"#multiple-sessions" title=
"Permanent link">#
</a></h3>
2157 <p>To allow for a proper separation of these long-lived user sessions, WoltLab Suite now allows for multiple sessions per user.
2158 These sessions are completely unrelated to each other.
2159 Specifically, they do not share session variables and they expire independently.
</p>
2160 <p>As the existing
<code>wcf1_session
</code> table is also used for the online lists and location tracking, it will be maintained on a best effort basis.
2161 It no longer stores any private session data.
</p>
2162 <p>The actual sessions storing security sensitive information are in an unrelated location.
2163 They must only be accessed via the PHP API exposed by the
<code>SessionHandler
</code>.
</p>
2164 <h3 id=
"merged-acp-and-frontend-sessions">Merged ACP and Frontend Sessions
<a class=
"headerlink" href=
"#merged-acp-and-frontend-sessions" title=
"Permanent link">#
</a></h3>
2165 <p>WoltLab Suite
5.4 shares a single session across both the frontend, as well as the ACP.
2166 When a user logs in to the frontend, they will also be logged into the ACP and vice versa.
</p>
2167 <p>Actual access to the ACP is controlled via the new
<a href=
"#reauthentication">reauthentication mechanism
</a>.
</p>
2168 <p>The session variable store is scoped:
2169 Session variables set within the frontend are not available within the ACP and vice versa.
</p>
2170 <h3 id=
"improved-authentication-and-reauthentication">Improved Authentication and Reauthentication
<a class=
"headerlink" href=
"#improved-authentication-and-reauthentication" title=
"Permanent link">#
</a></h3>
2171 <p>WoltLab Suite
5.4 ships with multi-factor authentication support and a generic re-authentication implementation that can be used to verify the account owner’s presence.
</p>
2172 <h2 id=
"additions-and-changes">Additions and Changes
<a class=
"headerlink" href=
"#additions-and-changes" title=
"Permanent link">#
</a></h2>
2173 <h3 id=
"password-hashing">Password Hashing
<a class=
"headerlink" href=
"#password-hashing" title=
"Permanent link">#
</a></h3>
2174 <p>WoltLab Suite
5.4 includes a new object-oriented password hashing framework that is modeled after PHP’s
<code>password_*
</code> API.
2175 Check
<a href=
"https://github.com/WoltLab/WCF/blob/master/wcfsetup/install/files/lib/system/user/authentication/password/PasswordAlgorithmManager.class.php"><code>PasswordAlgorithmManager
</code></a> and
<a href=
"https://github.com/WoltLab/WCF/blob/master/wcfsetup/install/files/lib/system/user/authentication/password/IPasswordAlgorithm.class.php"><code>IPasswordAlgorithm
</code></a> for details.
</p>
2176 <p>The new default password hash is a standard BCrypt hash.
2177 All newly generated hashes in
<code>wcf1_user.password
</code> will now include a type prefix, instead of just passwords imported from other systems.
</p>
2178 <h3 id=
"session-storage">Session Storage
<a class=
"headerlink" href=
"#session-storage" title=
"Permanent link">#
</a></h3>
2179 <p>The
<code>wcf1_session
</code> table will no longer be used for session storage.
2180 Instead, it is maintained for compatibility with existing online lists.
</p>
2181 <p>The actual session storage is considered an implementation detail and you
<em>must not
</em> directly interact with the session tables.
2182 Future versions might support alternative session backends, such as Redis.
</p>
2183 <div class=
"admonition warning">
2184 <p class=
"admonition-title">Do not interact directly with the session database tables but only via the
<code>SessionHandler
</code> class!
</p>
2186 <h3 id=
"reauthentication">Reauthentication
<a class=
"headerlink" href=
"#reauthentication" title=
"Permanent link">#
</a></h3>
2187 <p>For security sensitive processing, you might want to ensure that the account owner is actually present instead of a third party accessing a session that was accidentally left logged in.
</p>
2188 <p>WoltLab Suite
5.4 ships with a generic reauthentication framework.
2189 To request reauthentication within your controller you need to:
</p>
2191 <li>Use the
<code>wcf\system\user\authentication\TReauthenticationCheck
</code> trait.
</li>
2193 <div class=
"highlight"><pre><span></span><code><span class=
"nv">$this
</span><span class=
"o">-
></span><span class=
"na">requestReauthentication
</span><span class=
"p">(
</span><span class=
"nx">LinkHandler
</span><span class=
"o">::
</span><span class=
"na">getInstance
</span><span class=
"p">()
</span><span class=
"o">-
></span><span class=
"na">getControllerLink
</span><span class=
"p">(
</span><span class=
"k">static
</span><span class=
"o">::
</span><span class=
"na">class
</span><span class=
"p">,
</span> <span class=
"p">[
</span>
2194 <span class=
"cm">/* additional parameters */
</span>
2195 <span class=
"p">]));
</span>
2196 </code></pre></div></li>
2198 <p><code>requestReauthentication()
</code> will check if the user has recently authenticated themselves.
2199 If they did, the request proceeds as usual.
2200 Otherwise, they will be asked to reauthenticate themselves.
2201 After the successful authentication, they will be redirected to the URL that was passed as the first parameter (the current controller within the example).
</p>
2202 <p>Details can be found in
<a href=
"https://github.com/WoltLab/WCF/pull/3775">WoltLab/WCF#
3775</a>.
</p>
2203 <h3 id=
"multi-factor-authentication">Multi-factor Authentication
<a class=
"headerlink" href=
"#multi-factor-authentication" title=
"Permanent link">#
</a></h3>
2204 <p>To implement multi-factor authentication securely, WoltLab Suite
5.4 implements the concept of a “pending user change”.
2205 The user will not be logged in (i.e.
<code>WCF::getUser()-
>userID
</code> returns
<code>null
</code>) until they authenticate themselves with their second factor.
</p>
2206 <p>Requesting multi-factor authentication is done on an opt-in basis for compatibility reasons.
2207 If you perform authentication yourself and do not trust the authentication source to perform multi-factor authentication itself, you will need to adjust your logic to request multi-factor authentication from WoltLab Suite:
</p>
2209 <div class=
"highlight"><pre><span></span><code><span class=
"nx">WCF
</span><span class=
"o">::
</span><span class=
"na">getSession
</span><span class=
"p">()
</span><span class=
"o">-
></span><span class=
"na">changeUser
</span><span class=
"p">(
</span><span class=
"nv">$targetUser
</span><span class=
"p">);
</span>
2212 <div class=
"highlight"><pre><span></span><code><span class=
"nv">$isPending
</span> <span class=
"o">=
</span> <span class=
"nx">WCF
</span><span class=
"o">::
</span><span class=
"na">getSession
</span><span class=
"p">()
</span><span class=
"o">-
></span><span class=
"na">changeUserAfterMultifactorAuthentication
</span><span class=
"p">(
</span><span class=
"nv">$targetUser
</span><span class=
"p">);
</span>
2213 <span class=
"k">if
</span> <span class=
"p">(
</span><span class=
"nv">$isPending
</span><span class=
"p">)
</span> <span class=
"p">{
</span>
2214 <span class=
"c1">// Redirect to the authentication form. The user will not be logged in.
</span>
2215 <span class=
"c1">// Note: Do not use `getControllerLink` to support both the frontend as well as the ACP.
</span>
2216 <span class=
"nx">HeaderUtil
</span><span class=
"o">::
</span><span class=
"na">redirect
</span><span class=
"p">(
</span><span class=
"nx">LinkHandler
</span><span class=
"o">::
</span><span class=
"na">getInstance
</span><span class=
"p">()
</span><span class=
"o">-
></span><span class=
"na">getLink
</span><span class=
"p">(
</span><span class=
"s1">'MultifactorAuthentication
'</span><span class=
"p">,
</span> <span class=
"p">[
</span>
2217 <span class=
"s1">'url
'</span> <span class=
"o">=
></span> <span class=
"cm">/* Return To */
</span><span class=
"p">,
</span>
2218 <span class=
"p">]));
</span>
2219 <span class=
"k">exit
</span><span class=
"p">;
</span>
2220 <span class=
"p">}
</span>
2221 <span class=
"c1">// Proceed as usual. The user will be logged in.
</span>
2223 <h4 id=
"adding-multi-factor-methods">Adding Multi-factor Methods
<a class=
"headerlink" href=
"#adding-multi-factor-methods" title=
"Permanent link">#
</a></h4>
2224 <p>Adding your own multi-factor method requires the implementation of a single object type:
</p>
2225 <div class=
"highlight"><pre><span></span><code><span class=
"nt"><type
></span>
2226 <span class=
"nt"><name
></span>com.example.multifactor.foobar
<span class=
"nt"></name
></span>
2227 <span class=
"nt"><definitionname
></span>com.woltlab.wcf.multifactor
<span class=
"nt"></definitionname
></span>
2228 <span class=
"nt"><icon
></span><span class=
"c"><!-- Font Awesome
4 Icon Name goes here. --
></span><span class=
"nt"></icon
></span>
2229 <span class=
"nt"><priority
></span><span class=
"c"><!-- Determines the sort order, higher priority will be preferred for authentication. --
></span><span class=
"nt"></priority
></span>
2230 <span class=
"nt"><classname
></span>wcf\system\user\multifactor\FoobarMultifactorMethod
<span class=
"nt"></classname
></span>
2231 <span class=
"nt"></type
></span>
2233 <p>The given classname must implement the
<a href=
"https://github.com/WoltLab/WCF/blob/master/wcfsetup/install/files/lib/system/user/multifactor/IMultifactorMethod.class.php"><code>IMultifactorMethod
</code></a> interface.
</p>
2234 <p>As a self-contained example, you can find the initial implementation of the email multi-factor method in
<a href=
"https://github.com/WoltLab/WCF/pull/3729">WoltLab/WCF#
3729</a>.
2235 Please check
<a href=
"https://github.com/WoltLab/WCF/commits/master/wcfsetup/install/files/lib/system/user/multifactor/EmailMultifactorMethod.class.php">the version history
</a> of the PHP class to make sure you do not miss important changes that were added later.
</p>
2236 <div class=
"admonition warning">
2237 <p class=
"admonition-title">Multi-factor authentication is security sensitive. Make sure to carefully read the remarks in
<code>IMultifactorMethod
</code> for possible issues. Also make sure to carefully test your implementation against all sorts of incorrect input and consider attack vectors such as race conditions. It is strongly recommended to generously check the current state by leveraging assertions and exceptions.
</p>
2239 <h2 id=
"deprecations-and-removals">Deprecations and Removals
<a class=
"headerlink" href=
"#deprecations-and-removals" title=
"Permanent link">#
</a></h2>
2240 <h3 id=
"sessionhandler">SessionHandler
<a class=
"headerlink" href=
"#sessionhandler" title=
"Permanent link">#
</a></h3>
2241 <p>Most of the changes with regard to the new session handling happened in
<code>SessionHandler
</code>.
2242 Most notably,
<code>SessionHandler
</code> now is marked
<code>final
</code> to ensure proper encapsulation of data.
</p>
2243 <p>A number of methods in
<code>SessionHandler
</code> are now deprecated and result in a noop.
2244 This change mostly affects methods that have been used to bootstrap the session, such as
<code>setHasValidCookie()
</code>.
</p>
2245 <p>Additionally, accessing the following keys on the session is deprecated.
2246 They directly map to an existing method in another class and any uses can easily be updated:
2247 -
<code>ipAddress
</code>
2248 -
<code>userAgent
</code>
2249 -
<code>requestURI
</code>
2250 -
<code>requestMethod
</code>
2251 -
<code>lastActivityTime
</code></p>
2252 <p>Refer to
<a href=
"https://github.com/WoltLab/WCF/blob/439de4963c947c3569a0c584f795245f693155b0/wcfsetup/install/files/lib/system/session/SessionHandler.class.php#L168-L178">the implementation
</a> for details.
</p>
2253 <h3 id=
"acp-sessions">ACP Sessions
<a class=
"headerlink" href=
"#acp-sessions" title=
"Permanent link">#
</a></h3>
2254 <p>The database tables related to ACP sessions have been removed.
2255 The PHP classes have been preserved due to being used within the class hierarchy of the legacy sessions.
</p>
2256 <h3 id=
"cookies">Cookies
<a class=
"headerlink" href=
"#cookies" title=
"Permanent link">#
</a></h3>
2257 <p>The
<code>_userID
</code>,
<code>_password
</code>,
<code>_cookieHash
</code> and
<code>_cookieHash_acp
</code> cookies will no longer be created nor consumed.
</p>
2258 <h3 id=
"virtual-sessions">Virtual Sessions
<a class=
"headerlink" href=
"#virtual-sessions" title=
"Permanent link">#
</a></h3>
2259 <p>The virtual session logic existed to support multiple devices per single session in
<code>wcf1_session
</code>.
2260 Virtual sessions are no longer required with the refactored session handling.
</p>
2261 <p>Anything related to virtual sessions has been completely removed as they are considered an implementation detail.
2262 This removal includes PHP classes and database tables.
</p>
2263 <h3 id=
"security-token-constants">Security Token Constants
<a class=
"headerlink" href=
"#security-token-constants" title=
"Permanent link">#
</a></h3>
2264 <p>The security token constants are deprecated.
2265 Instead, the methods of
<code>SessionHandler
</code> should be used (e.g.
<code>-
>getSecurityToken()
</code>).
2266 Within templates, you should migrate to the
<code>{csrfToken}
</code> tag in place of
<code>{@SECURITY_TOKEN_INPUT_TAG}
</code>.
2267 The
<code>{csrfToken}
</code> tag is a drop-in replacement and was backported to WoltLab Suite
5.2+, allowing you to maintain compatibility across a broad range of versions.
</p>
2268 <h3 id=
"passwordutil-and-double-bcrypt-hashes">PasswordUtil and Double BCrypt Hashes
<a class=
"headerlink" href=
"#passwordutil-and-double-bcrypt-hashes" title=
"Permanent link">#
</a></h3>
2269 <p>Most of the methods in PasswordUtil are deprecated in favor of the new password hashing framework.
</p>
2275 <div class=
"md-source-date">
2278 Last update:
2021-
02-
11
2297 <footer class=
"md-footer">
2299 <nav class=
"md-footer__inner md-grid" aria-label=
"Footer">
2301 <a href=
"../php/" class=
"md-footer__link md-footer__link--prev" rel=
"prev">
2302 <div class=
"md-footer__button md-icon">
2303 <svg xmlns=
"http://www.w3.org/2000/svg" viewBox=
"0 0 24 24"><path d=
"M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12z"/></svg>
2305 <div class=
"md-footer__title">
2306 <div class=
"md-ellipsis">
2307 <span class=
"md-footer__direction">
2316 <a href=
"../javascript/" class=
"md-footer__link md-footer__link--next" rel=
"next">
2317 <div class=
"md-footer__title">
2318 <div class=
"md-ellipsis">
2319 <span class=
"md-footer__direction">
2325 <div class=
"md-footer__button md-icon">
2326 <svg xmlns=
"http://www.w3.org/2000/svg" viewBox=
"0 0 24 24"><path d=
"M4 11v2h12l-5.5 5.5 1.42 1.42L19.84 12l-7.92-7.92L10.5 5.5 16 11H4z"/></svg>
2332 <div class=
"md-footer-meta md-typeset">
2333 <div class=
"md-footer-meta__inner md-grid">
2334 <div class=
"md-footer-copyright">
2336 <div class=
"md-footer-copyright__highlight">
2337 Copyright ©
2020 WoltLab GmbH
2341 <a href=
"https://squidfunk.github.io/mkdocs-material/" target=
"_blank" rel=
"noopener">
2346 <div class=
"md-footer-copyright">
2347 <a href=
"https://www.woltlab.com/legal-notice/">Legal Notice
</a>
2348 <a href=
"https://www.woltlab.com/privacy-policy/">Privacy Policy
</a>
2355 <div class=
"md-dialog" data-md-component=
"dialog">
2356 <div class=
"md-dialog__inner md-typeset"></div>
2358 <script id=
"__config" type=
"application/json">{
"base":
"../../..",
"features": [],
"translations": {
"clipboard.copy":
"Copy to clipboard",
"clipboard.copied":
"Copied to clipboard",
"search.config.lang":
"en",
"search.config.pipeline":
"trimmer, stopWordFilter",
"search.config.separator":
"[\\s\\-]+",
"search.placeholder":
"Search",
"search.result.placeholder":
"Type to start searching",
"search.result.none":
"No matching documents",
"search.result.one":
"1 matching document",
"search.result.other":
"# matching documents",
"search.result.more.one":
"1 more on this page",
"search.result.more.other":
"# more on this page",
"search.result.term.missing":
"Missing"},
"search":
"../../../assets/javascripts/workers/search.fe42c31b.min.js",
"version": {
"provider":
"mike"}}
</script>
2361 <script src=
"../../../assets/javascripts/bundle.d892486b.min.js"></script>