Posted on 2008-06-30 04:40:58-07 by nekatreven in response to 8197
Re: reuse dbh handle with mysql
The following is the log from mysql that was written while I was troubleshooting. Connect and query set 8 occurred when I thought maybe the handle was going out of scope. I added a useless query below the section for the session by looking for the user 'cheesypoofs' after the attempt at the new session. The results were no different.

9 and 10 were when I thought I might need to $dbh->disconnect() before the session->new();. As you can see it just made a new connection, no other changes.

What is odd is that, as you can see, the session id is not changing. I have a debug print statement for the id in my code, and that is not the ID that is being generated. However there are no session rows in MySql and I've cleared the cookies in my browser. (server and client are same machine at the moment)
8 Connect *******@localhost on test 8 Query set autocommit=1 8 Query SELECT username FROM users WHERE username = 'bob' 8 Query SELECT password FROM users WHERE username = 'bob' 8 Query SELECT a_session FROM sessions WHERE id='c11b3b1e9fdb1f0305734017fb25ee88' 8 Query SELECT password FROM users WHERE username = 'cheesypoofs' 8 Quit 9 Connect *********@localhost on test 9 Query set autocommit=1 9 Query SELECT username FROM users WHERE username = 'bob' 9 Query SELECT password FROM users WHERE username = 'bob' 9 Quit 10 Connect root@localhost on test 10 Query SELECT a_session FROM sessions WHERE id='c11b3b1e9fdb1f0305734017fb25ee88'
Direct Responses: Write a response
Perl Weekly newsletter
A free weekly newsletter for people who are busy to read all the blogs. click here to check it out.