[Solved] Expire Session Question |
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');
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');
There's only one rule - please don't tell anyone to go and read the manual. Sometimes the manual just SUCKS!
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. |
Welcome Guest, Not a member yet? Register Sign In |