Session disappears and re-appears? - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Session disappears and re-appears? (/showthread.php?tid=44205) |
Session disappears and re-appears? - El Forum - 08-07-2011 [eluser]SitesByJoe[/eluser] Okay, I'm scratching my head over this one so maybe some of you guys have some advice. I built a site http://www.collegescholarships.com and I use Sessions and Erkanaauth. When a user logs in 2 things should happen: 1. The top of the pages give a "Hi There {username)" messages and, 2. The link in the navigation that says "Find Scholarships" changes to "My Scholarships". I thought everything was working fine, but the weirdest thing happens: On a couple pages on the site, my session disappears. If I go to a different page it comes back! So digging in a little further, here's the view that shows the account message: Code: <?php if ($this->erkanaauth->try_profile_session_login()) : ?> And the navigation does the same: Code: <?php if ( ! $this->erkanaauth->try_profile_session_login()) : // not logged in ?> We trace that back to the Erkanaauth library, where I have this function: Code: function try_profile_session_login() The logout function does this: Code: function profile_logout() I don't think the user is logged out since going to a new page brings the session back. What do you think is going wrong? It's only the homepage and maybe 3 other pages that do this. Too weird! Here's my home/index function (one of the bad pages). You can see I'm not touching the session. Code: function index() Session disappears and re-appears? - El Forum - 08-07-2011 [eluser]scottwire[/eluser] Perhaps it has to do with you caching the page? I would start by commenting out the caching or deleting the cache and refreshing the page after you log in. If you're not already, your fix would be to clear cache when logging in as well as after logging out. Session disappears and re-appears? - El Forum - 08-07-2011 [eluser]SitesByJoe[/eluser] Oh my god - I can't believe I missed that! |