CI Sessions - No user data |
[eluser]robjstanley[/eluser]
Can you be a bit more descriptive? i have no idea what you're talking about.
[eluser]robjstanley[/eluser]
i added an echo to the construct to display the session data and it only echo's from pages other than index
[eluser]toopay[/eluser]
@robjstanley... You should give some more intuitive name. Lets say, if you are about create a controller that will be your main controller, why dont use something like "base" or "main" instead "view". And what the result for defining a variable in consctruct of View class, to see what inside Session userdata, and make it available to any functiom below it. Is it working?
[eluser]InsiteFX[/eluser]
Then extend all your other controllers from MY_Controller Code: class MY_Controller extends Controller InsiteFX
[eluser]robjstanley[/eluser]
No it only works for pages that are not index. I called it view because i wanted the url to make sense. I figured /view/about/ etc would make more sense to the user than /main/about/
[eluser]InsiteFX[/eluser]
I think his problem is that hes extending Login as Controller and View as Controller when he should be extending them both from a MY_Controller! InsiteFX
[eluser]toopay[/eluser]
actually, you could even get better result, such as www.site.com/home for homepage, www.site.com/about for about page, with setting up some route like this : Code: $route['home'] = 'view/home';
[eluser]toopay[/eluser]
@InsiteFX, He doest use some auth module or something sophisticated, like the example structure you gave. He just try to use some controller, as authentification process and use another controller to display page. His only problems, i believed, is the CI session is doesnt work as he expected.
[eluser]InsiteFX[/eluser]
@toopay Thhat was just an example! I just showed the example because I think he would be better off using a MY_Controller. InsiteFX |
Welcome Guest, Not a member yet? Register Sign In |