![]() |
Randomly redirects - 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: Randomly redirects (/showthread.php?tid=35710) |
Randomly redirects - El Forum - 11-08-2010 [eluser]stuffradio[/eluser] This is a weird problem I've been spending an hour trying to figure out. It's a simple thing where it updates a field in the database. The page: Code: <div class="clearfix"> The console function Code: function updateConsole() The model function Code: function updateConsole($name, $id) It redirects sometimes to ccenter/Members/logout, but no where in my code do I have something for redirecting to that page... only in the header for a user to click on to logout. It's really weird. Randomly redirects - El Forum - 11-08-2010 [eluser]tonanbarbarian[/eluser] i suspect by your mention of redirection to a logout page that you have some sort of session that you use to control access to the site. i suggest the issue is probably nothing to do with your code here, but with your authentication system, which you have provided not details about Randomly redirects - El Forum - 11-08-2010 [eluser]stuffradio[/eluser] Because I don't use the logout page for my session authentication. It simply destroys the session and redirects to the login page. Randomly redirects - El Forum - 11-08-2010 [eluser]tonanbarbarian[/eluser] all i can suggest is search your entire project for the logout page or redirects and see if any of them could be redirecting to the page in question and track back from there my money is still on the authentication system because the timeouts are "random" (no such thing really), the issue is most likely that the cookie or whatever is used for the session processing has expired and so the authentication system is causing the redirect. is it your own hand coded authentication system or have you used a pre-existing library? If you wrote the authentication system then I assume you know it well and I would be more willing to look elsewhere for a solution but if you are using a third party authentication library then I would say have a good look at the code as it may be the cause of the issue. Randomly redirects - El Forum - 11-08-2010 [eluser]stuffradio[/eluser] It's my own system. Also, firebug gives me this error when it happens "Failed to load source for" and the url it gives me is the logout page. Randomly redirects - El Forum - 11-09-2010 [eluser]tonanbarbarian[/eluser] check your weblogs and see if that is the page it is really being redirected to, or it is something that firebug is doing maybe even temporarily disable firebug and try to replicate the problem if you are sure there is no code in your system that ever redirects to the logout page then maybe firebug is doing something silly perhaps the page is partially being displayed and firebug is grabbing some of the text of the page, i.e. the logout link try replicating the bug in other browsers try installing the Live HTTP headers extension for firefox which records all request and you will be able to see exactly how the redirects are processing, what cookies are being passed back and forth etc Randomly redirects - El Forum - 11-09-2010 [eluser]stuffradio[/eluser] It does it in IE 9 as well. Live HTTP headers is not valid with FireFox 4 Randomly redirects - El Forum - 11-09-2010 [eluser]tonanbarbarian[/eluser] then it is unlikely to be firebug that is the issue are we are back to some code somewhere that is redirecting to this page. Look for every call to redirect and check them all thats about all I can suggest and checks the logs at the time of the issue and see what urls are being requested from the server Randomly redirects - El Forum - 11-09-2010 [eluser]stuffradio[/eluser] Thanks for all your help tonan. I'm not sure if I actually fixed it, but I must have tried over 20 times now and it hasn't happened again. I changed a hidden id with the name of "id" to "consoleid" and it hasn't done anything since. I'm praying that answered the problem! ![]() Edit: Knock on wood, right after I posted it happened again. Edit 2: Since it's a small thing to do, I'll just make it so you delete the console and make a new one. |