CodeIgniter Forums
redirect() and db connection - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: redirect() and db connection (/thread-12073.html)



redirect() and db connection - El Forum - 10-04-2008

[eluser]m4rw3r[/eluser]
When I started to do an auth with drop in folder protection, I took a look at redirect() to see what it needs to do a redirect.

And it does not close the DB connection, it just sends a header then calls exit().

I've searched for a shutdown_function, but I didn't find it, so it seems to skip the closing of the db connection completely.

Should it skip the DB connection closing, it doesn't skip it during normal requests (without redirect())?


redirect() and db connection - El Forum - 10-05-2008

[eluser]Seppo[/eluser]
I don't think the connections should be closed at all... If you are using permanent connection the idea is to keep them open after the execution finished, and if you aren't using it, the "link to the server will be closed as soon as the execution of the script ends", so closing the connection in the normal requests seems to be wrong and not keeping it open on redirect.


redirect() and db connection - El Forum - 10-05-2008

[eluser]m4rw3r[/eluser]
If my mind serves me right there were some problems with the pconnect setting, which might be explained by the fact that CI always closes the connection, no matter if it is a permanent one or not (correct me if I'm wrong).