[Solved] Expire Session Question - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: [Solved] Expire Session Question (/showthread.php?tid=69566) |
[Solved] Expire Session Question - wolfgang1983 - 12-15-2017 When the user first login email or user name correct I set a custom session token I when I set the token I would only like that token to last for 5 min then unset it self How can I make sure that after 5min then only that session data will expire and unset. PHP Code: $this->load->helper('string'); PHP Code: <?php defined('BASEPATH') OR exit('No direct script access allowed'); RE: Expire Session Question - wolfgang1983 - 12-15-2017 I think I have solved it now PHP Code: $this->session->set_tempdata(array('login_token' => $token), NULL, 300); PWD Function PHP Code: if (!$this->session->userdata('login_token') || !$this->session->tempdata('login_token')) { PHP Code: <?php defined('BASEPATH') OR exit('No direct script access allowed'); RE: [Solved] Expire Session Question - Narf - 12-20-2017 You solved one problem, but you don't know that you have another one. random_string() is not random; the manual itself says NOT to use the string helper for anything security-sensitive. |