Welcome Guest, Not a member yet? Register   Sign In
function in a controller unusable
#1

[eluser]Unknown[/eluser]
Hello!

I am having this problem with CI:

I have a public function named `logout` in my controller named `user`.
this function *destroys* session.

now, {base_url}user/logout works fine *some times*. and some times, it doesn't.

rather, it just redirects to the previous page (page on which the link {base_url}user/logout was clicked).

when it is like this(redirecting back), the changes i make to the function aren't effecting the output!

i just removed the function and loaded {base_url}user/logout and it still worked! why? there was no function to respond.
I should get 404.
right?

it seems to me that somewhere CI is caching and there is some bug with cache (this is really wild guess)
OR
the session isn't being destroyed and since my session still exists, i am rightfully being redirected.
..
no but i was getting a page even when there wasn't a function! definitely bug!

please help me?

details you might need:
ubuntu 11.04, apache, php, mysql (all latest, updated).
codeigniter 2.0.3


EDIT:
killed the bug (in my code).
Was sending a permanently redirected header in my code. firefox seems to remember the links and their moved locations. so that was the bug. changed 3rd param of redirect to 307 from 301. solved!




Theme © iAndrew 2016 - Forum software by © MyBB