Sessions - Not Working - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Development (https://forum.codeigniter.com/forumdisplay.php?fid=6) +--- Forum: CodeIgniter 3.x (https://forum.codeigniter.com/forumdisplay.php?fid=17) +--- Thread: Sessions - Not Working (/showthread.php?tid=62262) |
RE: Sessions - Not Working - iD30 - 06-26-2015 (06-26-2015, 04:13 AM)Narf Wrote:(06-26-2015, 03:33 AM)iD30 Wrote:(06-26-2015, 03:22 AM)Narf Wrote:(06-26-2015, 03:04 AM)iD30 Wrote:(06-26-2015, 02:59 AM)Narf Wrote: I assume you've copy-pasted the new CI files over the old ones instead of deleting the old system/ directory and putting the new one in its place ... If that's the case - delete system/libraries/Session.php. Firstly, You shouldn't assume anything, you should ask. Secondly, regardless of me putting up the word "log" or not you STILL shouldn't assumed. Thirdly, If I felt the log output was relevant to the error or gave any indications of the error (which is doesn't), I would firstly investigate the error and possible solutions myself (making the effort), failing that, I would added the LOG output to my write up to give further help to the people I am asking help from. Fourth, Just because I am a "first-time poster" shouldn't automatically put me in the category of "not making any effort to help themselves". I am not or haven't "blamed" you for anything let alone "assuming". RE: Sessions - Not Working - iD30 - 06-26-2015 (06-26-2015, 05:26 AM)ivantcholakov Wrote: @iD30 Thanks for you reply ivantcholakov The framework download was direct from http://www.codeigniter.com/ Your Low probability - As far as I am aware there isn't any accelerator, but I will double check to make sure - anything is possible. RE: Sessions - Not Working - Narf - 06-26-2015 (06-26-2015, 05:46 AM)iD30 Wrote: Firstly, You shouldn't assume anything, you should ask. So ... you said you felt insulted, in this very post you're telling me 3 times not to assume, yet you're not blaming me for doing that? I find that hard to believe, especially with you being that condescending. Like it or not, when a first-time poster says "X is not working", having shown no log messages, not even mentioning logs - me and many others will assume that this person has not looked at the log files, because it's the logical thing to do. I was wrong in my assumption and I already admitted that, but don't tell me what to do and what not to do. Also, a lack of an error message in the logs does not mean they are not relevant to the problem. And in fact, at least one session-related message would appear in the log files if you used $this->load->library('session') like you're supposed to. RE: Sessions - Not Working - iD30 - 06-26-2015 OK Narf, lets agree to disagree you can keep your assumptions and I will keep my opinions on your approach to my issue. I came to the forum for help not an argument. Re: Your Log session-related - Yes it did output this: Code: PHP Fatal error: Call to a member function userdata() on a non-object in /Users/******/Sites/********/application/libraries/Session_management.php on line 169 But I didn't deem this of any use as I know why this error is occurring - due to no Session object being initiated unless put as: Code: $this->load->driver('session') On a more positive note: I seem to of solved the issue by running a complete install of CI 3.0.0 and migrating the files needed across and changing configs where needed, seems as though following the upgrade tutorial didn't work as first expected, possibly due to a copy-paste file that was holding CI 2.0.x code/data, but where I don't know - as previously wrote I removed (deleted) the system file and added the new CI 3.0.0 (after already doing ht e CI 2.0.x - CI 3.0.0 upgrade) Narf - No hard feelings, thank you for your time and argument, its made my day go faster ivantcholakov - Thank you for your contribution on this issue too. I appreciate you taking the time. RE: Sessions - Not Working - iD30 - 06-26-2015 Actually - after to further testing it hasn't fixed it. :/ RE: Sessions - Not Working - Narf - 06-26-2015 (06-26-2015, 07:22 AM)iD30 Wrote: OK Narf, lets agree to disagree you can keep your assumptions and I will keep my opinions on your approach to my issue. Agreed. (06-26-2015, 07:22 AM)iD30 Wrote: Re: Your Log session-related - Yes it did output this: Is this from the CodeIgniter logs or somewhere else? I was referring to a line generated by CI_Loader::library() that says if the requested library is loaded or not. RE: Sessions - Not Working - iD30 - 06-26-2015 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') Can anyone else (@Narf) confirm this to be the same? RE: Sessions - Not Working - iD30 - 06-26-2015 Narf: log of all classes being loaded. Code: INFO - 2015-06-26 16:40:16 --> Config Class Initialized RE: Sessions - Not Working - Narf - 06-26-2015 (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). 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. RE: Sessions - Not Working - iD30 - 06-29-2015 (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). 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+ |