Welcome Guest, Not a member yet? Register   Sign In
Can you exclude an autoloaded Class from a single page?
#1

[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
#2

[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?
#3

[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...
#4

[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.)
#5

[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
#6

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

R




Theme © iAndrew 2016 - Forum software by © MyBB