Session_start() with mysql_pconnect()

software development

#1

how do sessions ie. session_start() act with mysql_pconnect? If you kill the session with session_destroy() does the persistent connection stay?

example:

Someone logs on to my website using the session_start() function. The queries that are made AFTER logging on use mysql_pconnect. After killing the connection using session_destroy() how does MySQL handle the persistant connection? Does it keep it open and just wait to see if the session is restarted with the same user? I’ve looked all over for information about this and have found sqaut! Thanks in advance!


#2

Since when does session_destroy() kill any type of connection? According to PHP Manual - session_set_save_handler(), by default all it does is delete a file from disk.

In any case, once you call mysql_pconnect, you’re basically telling PHP not to allow that script to close the connection to the database. Kinda like getting a phone call where more than one person wants to talk to you so they just hand their phone on to the next person. No need for each person to hang up and dial your number if they are all at the same phone at relatively the same time.

:cool: Perl / MySQL / HTML+CSS