|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
Ok - I think this is a little rediculous (for all you php folks)
I reported a bug to the php bug database. This was the exact post:
Subject: Code:
Problem with session_set_save_handler() when connecting to db outside of obj Message: Code:
When connecting to the database inside the class object, everything works fine with session_set_save_handler(). But, when connecting outside of the class that holds the methods, php does'nt recognize there is an active connection to the DB. Is this a known problem that I have overlooked in the bug db? I have tried everything, including passing the res id of the connection into the session handler class but to no avail. ~ Thanks How many people here can see from this message what is going on - or be able to tell from this what I am getting at - this is the simplest of all things to understand, is it not? ----------------------------------------------------------- Post your replies and I will post what they came back with.
__________________
~ Joe Penn |
|
#2
|
||||
|
||||
|
Sounds like:
1)you're using a class that stores your session vars in a DB 2)when your db connection code is in that class sessions work fine 3)when you open a db connection outside your class and try and pass the connection ID into the class so that it can be used for storing your info it doesn't work. Is that right? |
|
#3
|
||||
|
||||
|
They are connecting out of scope and expecting it to work. Correct?
|
|
#4
|
||||
|
||||
|
Ya it's clear
|
|
#5
|
|||
|
|||
|
Quote:
jpenn, it really shouldn't matter... PHP should internally return the same connection on a subsequent connection to the same host,username & password (& database depending on the RDBMS used). Check what resource ID is being returned in each and compare.
__________________
FSBO (For Sale By Owner) Realty |
|
#6
|
||||
|
||||
|
Quote:
hehe - thats the bug Rod - it should'nt matter, but, it is not working when connecting outside of the class. So, this is how the sess_open() method looks (being the first arg to session_set_save_handler()) - PHP Code:
Ok - that is the open method that is passed to the function for setting the custom session handler - every thing works fine on this, as the connection is explicitly made within the method itself. Now, if removing the db connection outside this method (even if it is still in the same class) it will not register the session handler. So - the bug is this. How, can one use a db abstraction/connection library while using the custom session handling capabilities. This is the thing - the custom session handler needs to work with sub classes depending on what database is being used -> PHP Code:
I am sure it is nothing to do with the connection resource - for some reason if the connection is not made within the sess_open() method - the whole session handler fails. To get an idea of what I mean - you can get the class -> http://www.cheetah-soft.com/csh/ - remove the connection functions to outside the class and watch it not work. ----------------------------------- Hehe - I had asked if it was a clear question becuase the yahoo in the bug department seems to think it was not clear - I thought it was ![]() |
|
#7
|
||||
|
||||
|
PS: bcyde - that is exactly what it is. Apparently the guy that reviewed the bug does'nt understand english maybe...
|
|
#8
|
||||
|
||||
|
Hehe, just looked up the bug - what a tool
|
|
#9
|
||||
|
||||
|
%&#$*# - WTH - man, I can not understand these people. How can you have people working on bugs that can't even understand a simple dam post.
Man - I am fustrated about this. This thing is still going on and I am still trying to explain to this guy what the problem is. I feel like I am trying to explain the difference between single quotes and double quotes to a newbie. Look at the bug in full and give me your take on it: http://bugs.php.net/bug.php?id=24252 ![]() |
|
#10
|
||||
|
||||
|
I don't know what session_set_save_handler() means, but let me see if I understand:
If you connect to the DB out side of the class that session_set_save_handler() is in, then session_set_save_handler() no workie. HOWEVER, if you connect to the DB inside of the class that session_set_save_handler() is in, it workie. Is that right? |
|
#11
|
||||
|
||||
|
You got farther than he did by reading the bug for the first time. Yes, that is pretty much correct. session_set_save_handler() takes 6 arguments - they are all function names or method names. open,close,read,write,destroy,gc - if you do not connect to the db within the open method, it will fail.
I still can not understand what is so hard to understand about the bug post. |
|
#12
|
||||
|
||||
|
Just face it, those two are complete morons.
The post is simple and to the point. You couldn't do much more explaining than what you already have with it. |
![]() |
| Viewing: Dev Shed Forums > Other > Dev Shed Lounge > Ok - I think this is a little rediculous (for all you php folks) |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|