Welcome Guest, Not a member yet? Register   Sign In
Ajax request without extending session?
#1
Information 
(This post was last modified: 06-26-2016, 11:24 PM by JayAdra.)

Hi,

I've been trying for hours without success to implement a simple session timeout checking script.

I have an AJAX call which runs every X seconds to check if the session has expired. If so, the JS takes them to login screen. Simple enough, but I'm having an issue with checking for an expired session.

The problem is when the request is made, I can see the session cookie expiry is getting extended before the check is made, so it never reads it as "expired". I'm wondering if there's a way to tell CI not to extend/recreate this cookie on a specific request?

I tried not instantiating the session library, but wasn't sure how to check if the session expired then (tried empty($_SESSION) but it wasn't set).

So how can I do this? Check if the session has expired without altering its expiry when I run the check? I feel like there's a simple solution that I'm missing.

Any ideas are greatly appreciated!


Thanks,
Jay.
Reply


Messages In This Thread
Ajax request without extending session? - by JayAdra - 06-26-2016, 11:16 PM



Theme © iAndrew 2016 - Forum software by © MyBB