redirecting and alerting after the session has cleared |
01-25-2018, 09:59 AM
(This post was last modified: 01-25-2018, 10:52 AM by ciadmin. Edit Reason: cleared ransom note formatting )
I have found that if I leave my system sitting at one of its views for more than 7200 seconds (with no interaction) the session variable clears and I lose track of the name and userid of the user. What I'd like to do is popup an alert saying "you have been logged out" and display my Users view which is the login screen.
if (!isset($_SESSION['isUserLoggedIn'])){ //if the session has cleared log the user out redirect('Users'); } I have also tried $this->load->view('Users/logout'); instead of the redirect but "no go" The problem is that I am unable to alert and I am also unable to send the user back to the login screen. I have researched and discovered that I need to do this in javascript since PHP doesn't become active until the user interacts with the screen. But, my HTML file, which has some js on it, is not even displaying at this time. Is there any type of event I can get when $config['sess_expiration'] fires?
proof that an old dog can learn new tricks
|
Messages In This Thread |
redirecting and alerting after the session has cleared - by richb201 - 01-25-2018, 09:59 AM
RE: redirecting and alerting after the session has cleared - by dave friend - 01-25-2018, 10:47 AM
RE: redirecting and alerting after the session has cleared - by richb201 - 01-25-2018, 11:03 AM
RE: redirecting and alerting after the session has cleared - by richb201 - 01-25-2018, 12:19 PM
RE: redirecting and alerting after the session has cleared - by richb201 - 01-25-2018, 12:32 PM
|