CodeIgniter Forums
Can you exclude an autoloaded Class from a single page? - 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: Can you exclude an autoloaded Class from a single page? (/showthread.php?tid=32951)



Can you exclude an autoloaded Class from a single page? - El Forum - 08-10-2010

[eluser]russ_kern[/eluser]
Just started using CodeIgniter... So far I'm loving it... Great job...

One question I have that I haven't been able to sus out for myself yet...

I have the sessions class autoloaded through the config file. Is there a way to EXCLUDE it from a single page? The Login page for instance? Or do I need to include it Manually in every controller in order to exclude it from certain pages?

Help would be appreciated.

R


Can you exclude an autoloaded Class from a single page? - El Forum - 08-10-2010

[eluser]bretticus[/eluser]
Just curious as to why you need to exclude it. Just because the class is loaded, doesn't mean you have to use it, right?


Can you exclude an autoloaded Class from a single page? - El Forum - 08-10-2010

[eluser]russ_kern[/eluser]
Well... maybe I don't... that answer is just as good... I want to check if they have logged in against the session cookie... how is the best way to do that then?

Thanks for the quick reply...


Can you exclude an autoloaded Class from a single page? - El Forum - 08-10-2010

[eluser]bretticus[/eluser]
[quote author="russ_kern" date="1281489627"]Well... maybe I don't... that answer is just as good... I want to check if they have logged in against the session cookie... how is the best way to do that then?

Thanks for the quick reply...[/quote]

The nice thing about sessions is that the cookie part of it is abstracted away and you don't really even have to think about cookies.

It's simple, you set a session variable when they log in, and check for it in the pages that require a login. See set_userdata() and userdata() in the manual. (See "Retrieving Session Data" in particular.)


Can you exclude an autoloaded Class from a single page? - El Forum - 08-10-2010

[eluser]russ_kern[/eluser]
OK.. thanks a lot... I'll look at that... I was thinking that would have something to do with it... your suggestion makes me feel I'm doing it right... Smile


Can you exclude an autoloaded Class from a single page? - El Forum - 08-10-2010

[eluser]russ_kern[/eluser]
That worked well... thank you for pointing me in the right direction...

R