The following warnings occurred: | ||||||||||||
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.2.25 (Linux)
|
a little help - facebook login cookie - Printable Version +- UserSpice (https://userspice.com/forums) +-- Forum: Support Center (https://userspice.com/forums/forumdisplay.php?fid=23) +--- Forum: UserSpice 4.3 and Below (https://userspice.com/forums/forumdisplay.php?fid=26) +--- Thread: a little help - facebook login cookie (/showthread.php?tid=1044) |
a little help - facebook login cookie - tjones - 04-18-2018 So here is a little background. I am using UserSpice to setup a webview mobile app. Best practice is to make a user not have to login everytime they use it. I have modified the login to always run the "Remember Me" cookie and that works. However, most people want to use the facebook login. Anyone want to help me figure out how to make the cookie when someone logs in using Facebook. I have tried adding the below to the fb-callback.php right before the redirects $hash = Hash::unique(); Cookie::put($this->_cookieName, $hash, Config::get('remember/cookie_expiry')); It did not work. Any suggestions or help please? a little help - facebook login cookie - Brandin - 04-21-2018 fb-callback is where you would do this. I am not sure why exactly it is not working. This is taken from the User.php Class loginEmail which is what handles the remember. Try including all of this before any redirects on fb-callback. https://pastebin.com/1mrbpp7s a little help - facebook login cookie - tjones - 04-23-2018 Here is actually the working code for others needing to do the same thing. It took a good nights rest to figure it out, but user.php is never called so the "$this" construct doesn't exist. The below is pasted before both redirects in fb-callback.php. Hopefully others find it as useful as I do! $hash = Hash::unique(); $db->get('users_session' , array('user_id', '=', $_SESSION["user"])); $db->insert('users_session', array( 'user_id' => $_SESSION["user"], 'hash' => $hash, 'uagent' => Session::uagent_no_version() )); Cookie::put(Config::get('remember/cookie_name'), $hash, Config::get('remember/cookie_expiry')); a little help - facebook login cookie - Brandin - 04-24-2018 We're planning on overhauling FB and Google OAuth soon-the code is very slapped together and most of it makes no sense-but it is what worked at the time. I will add an option for enabling remember me expiry all the time for OAuth. B. |