@@ -188,12 +188,13 @@ public function create_persistent_session($userid) { // gets called from outside
188188 $ tokenHash = hash_hmac ('sha256 ' , $ token , "" , false );
189189
190190 // insert persistent session into DB
191- $ query = "INSERT into sessions_persistent (userid, expires_at, token_hash, created_at, valid, agent) values
192- (:userid, sysdate + interval '1' year, :token_hash, sysdate, 1, :useragent) " ;
191+ $ query = "INSERT into sessions_persistent (userid, expires_at, token_hash, created_at, valid, agent, referrer ) values
192+ (:userid, sysdate + interval '1' year, :token_hash, sysdate, 1, :useragent, :referrer ) " ;
193193 $ binds = [
194194 "userid " => $ userid ,
195195 "token_hash " => $ tokenHash ,
196- "useragent " => $ this ->getDeviceType ()
196+ "useragent " => $ this ->getDeviceType (),
197+ "referrer " => $ this ->getReferrer ()
197198 ];
198199
199200 $ DB ->query ($ query , $ binds );
@@ -245,6 +246,10 @@ public function create_session($userid) {
245246 $ query = "SELECT * from sessions where userid = :userid
246247 order by session_start desc fetch first 1 row only " ;
247248
249+ $ binds = [
250+ "userid " => $ userid ,
251+ ];
252+
248253 $ DB ->query ($ query , $ binds );
249254
250255 $ sess_ident = $ DB ->RSArray [0 ]['sess_ident ' ];
0 commit comments