Welcome Guest, Not a member yet? Register   Sign In
Sessions - Not Working
#20

(06-26-2015, 10:55 AM)Narf Wrote:
(06-26-2015, 09:30 AM)iD30 Wrote: I have come across something interesting, I am not sure if it is a bug or the fact it is a now a reserved name, however one of our Controllers is called Session.php, coincidentally & typical this is the main controller for login/out etc.... (session/login).

I renamed the controller and class to Test and then I was able to use the:



Code:
$this->load->library('session')
renamed is back to Session and it bugged out on me.

Can anyone else (@Narf) confirm this to be the same?

Ah, yes - that's surely the problem. It's not a bug, but also not exactly a reserved name either.

When you call $this->load->library('session'), there are a few checks done before CI knows that you want to actually load the CI_Session class ... class_exists('Session') returns TRUE and it stops there in order to avoid a fatal error.

Ahhh @Narf, Yes of course that makes sense.

I have renamed the Session.php Controller/Class to Account.php and this now works great and the Session_Management class loads from the library.

This project uses AJAX calling quite heavily in order to update views etc on the fly, I see that Session Blocking has been implement, so when I user logs in to the system using there user/pass credentials over an AJAX request the session is populated from the Session_Management class (as note previously in this thread) then redirected to the correct page with their privileges, low and be hold the session is now empty and the page is blank.

Is there a safe work around to keep a session active over AJAX or is this something now restricted in CI 3+
Reply


Messages In This Thread
Sessions - Not Working - by iD30 - 06-25-2015, 09:40 AM
RE: Sessions - Not Working - by Wouter60 - 06-25-2015, 10:34 AM
RE: Sessions - Not Working - by iD30 - 06-26-2015, 01:40 AM
RE: Sessions - Not Working - by iD30 - 06-26-2015, 02:22 AM
RE: Sessions - Not Working - by mike7418 - 11-14-2015, 12:29 PM
RE: Sessions - Not Working - by sv3tli0 - 11-15-2015, 02:26 AM
RE: Sessions - Not Working - by mike7418 - 11-15-2015, 04:31 PM
RE: Sessions - Not Working - by Narf - 06-26-2015, 02:59 AM
RE: Sessions - Not Working - by iD30 - 06-26-2015, 03:04 AM
RE: Sessions - Not Working - by Narf - 06-26-2015, 03:22 AM
RE: Sessions - Not Working - by iD30 - 06-26-2015, 03:33 AM
RE: Sessions - Not Working - by Narf - 06-26-2015, 04:13 AM
RE: Sessions - Not Working - by iD30 - 06-26-2015, 05:46 AM
RE: Sessions - Not Working - by Narf - 06-26-2015, 06:46 AM
RE: Sessions - Not Working - by ivantcholakov - 06-26-2015, 05:26 AM
RE: Sessions - Not Working - by iD30 - 06-26-2015, 05:51 AM
RE: Sessions - Not Working - by iD30 - 06-26-2015, 07:22 AM
RE: Sessions - Not Working - by Narf - 06-26-2015, 08:38 AM
RE: Sessions - Not Working - by iD30 - 06-26-2015, 08:11 AM
RE: Sessions - Not Working - by iD30 - 06-26-2015, 09:30 AM
RE: Sessions - Not Working - by Narf - 06-26-2015, 10:55 AM
RE: Sessions - Not Working - by iD30 - 06-29-2015, 02:15 AM
RE: Sessions - Not Working - by iD30 - 06-26-2015, 09:43 AM
RE: Sessions - Not Working [SOLVED] - by Narf - 06-29-2015, 03:18 AM
RE: [SOLVED] Sessions - Not Working - by iD30 - 07-02-2015, 09:23 AM
RE: Sessions - Not Working - by Narf - 07-03-2015, 01:34 AM
RE: Sessions - Not Working - by iD30 - 07-03-2015, 01:44 AM
RE: Sessions - Not Working - by jvandemerwe - 11-25-2015, 04:16 PM



Theme © iAndrew 2016 - Forum software by © MyBB