@@ -519,7 +519,7 @@ function session_begin($update_session_page = true)
519519 */
520520 function session_create ($ user_id = false , $ set_admin = false , $ persist_login = false , $ viewonline = true )
521521 {
522- global $ SID , $ _SID , $ db , $ config , $ cache , $ phpbb_root_path , $ phpEx , $ phpbb_container ;
522+ global $ SID , $ _SID , $ db , $ config , $ cache , $ phpbb_root_path , $ phpEx , $ phpbb_container, $ phpbb_dispatcher ;
523523
524524 $ this ->data = array ();
525525
@@ -851,6 +851,18 @@ function session_create($user_id = false, $set_admin = false, $persist_login = f
851851 $ _SID = $ this ->session_id ;
852852 $ this ->data = array_merge ($ this ->data , $ sql_ary );
853853
854+ /**
855+ * Event to send new session data to extension
856+ *
857+ * @event core.session_create
858+ * @var array session_data Associative array of session keys to be updated
859+ * @since 3.1.5-RC1
860+ */
861+ $ session_data = $ this ->data ;
862+ $ vars = array ('session_data ' );
863+ extract ($ phpbb_dispatcher ->trigger_event ('core.session_create ' , compact ($ vars )));
864+ unset($ session_data );
865+
854866 if (!$ bot )
855867 {
856868 $ cookie_expire = $ this ->time_now + (($ config ['max_autologin_time ' ]) ? 86400 * (int ) $ config ['max_autologin_time ' ] : 31536000 );
@@ -906,7 +918,7 @@ function session_create($user_id = false, $set_admin = false, $persist_login = f
906918 */
907919 function session_kill ($ new_session = true )
908920 {
909- global $ SID , $ _SID , $ db , $ config , $ phpbb_root_path , $ phpEx , $ phpbb_container ;
921+ global $ SID , $ _SID , $ db , $ config , $ phpbb_root_path , $ phpEx , $ phpbb_container, $ phpbb_dispatcher ;
910922
911923 $ sql = 'DELETE FROM ' . SESSIONS_TABLE . "
912924 WHERE session_id = ' " . $ db ->sql_escape ($ this ->session_id ) . "'
@@ -925,6 +937,8 @@ function session_kill($new_session = true)
925937 $ session_id = $ this ->session_id ;
926938 $ vars = array ('user_id ' , 'session_id ' );
927939 extract ($ phpbb_dispatcher ->trigger_event ('core.session_kill ' , compact ($ vars )));
940+ unset($ user_id );
941+ unset($ session_id );
928942
929943 // Allow connecting logout with external auth method logout
930944 $ provider_collection = $ phpbb_container ->get ('auth.provider_collection ' );
@@ -993,7 +1007,7 @@ function session_kill($new_session = true)
9931007 */
9941008 function session_gc ()
9951009 {
996- global $ db , $ config , $ phpbb_root_path , $ phpEx , $ phpbb_container ;
1010+ global $ db , $ config , $ phpbb_root_path , $ phpEx , $ phpbb_container, $ phpbb_dispatcher ;
9971011
9981012 $ batch_size = 10 ;
9991013
0 commit comments