CTru
asked on
OSCommerce & phpFox - Sessions and Cookies - Synched Logins
Hi All,
My project is to integrate phpFox & OSCommerce, both open source applications.
Am trying to implement an integration that does not have a dominant, or master side. That is without redirects, and does not use one or the other exclusively, to register or login or change information.
Each is presently in its own environment: phpFox in one folder, OSC in another, both folders in root.
Have already gotten most, if not all of the grunt work, and then some, done:
- Merged the user (phpFox) with customers and customers_info (OSC) database tables.
- Updated the necessary database column names in all files.
- Added queries to update one application while in the other (from either).
- Replaced password and verification process in OSC, with phpFox's.
What I presently have completed, is separate yet merged, and working. Meaning that when registering through the phpFox side, the OSC side is also registered (but not logged in); the customer then exists in OSC with the same registration information (i.e. email and password). And then can login from either side, phpFox or OSC. The same, visa versa (register in OSC & be registered in phpFox).
-------------------------- ---------- ---------- ---------- -----
To complete this project, all that's left to do is to have both applications be able to start a session and set cookies for the other, at the same time they're starting and setting their own. Or, perhaps, share a session and cookies.
I am looking to end up being able to register or login from either, and then be registered and/or logged in transparently/seamlessly to the other.
-------------------------- ---------- ---------- ---------- -----
I am hoping to be pointed in a direction. Looking for ideas or thoughts towards how I can go about it. Needing some help with this last part of my project.
Thanks for your time...
My project is to integrate phpFox & OSCommerce, both open source applications.
Am trying to implement an integration that does not have a dominant, or master side. That is without redirects, and does not use one or the other exclusively, to register or login or change information.
Each is presently in its own environment: phpFox in one folder, OSC in another, both folders in root.
Have already gotten most, if not all of the grunt work, and then some, done:
- Merged the user (phpFox) with customers and customers_info (OSC) database tables.
- Updated the necessary database column names in all files.
- Added queries to update one application while in the other (from either).
- Replaced password and verification process in OSC, with phpFox's.
What I presently have completed, is separate yet merged, and working. Meaning that when registering through the phpFox side, the OSC side is also registered (but not logged in); the customer then exists in OSC with the same registration information (i.e. email and password). And then can login from either side, phpFox or OSC. The same, visa versa (register in OSC & be registered in phpFox).
--------------------------
To complete this project, all that's left to do is to have both applications be able to start a session and set cookies for the other, at the same time they're starting and setting their own. Or, perhaps, share a session and cookies.
I am looking to end up being able to register or login from either, and then be registered and/or logged in transparently/seamlessly to the other.
--------------------------
I am hoping to be pointed in a direction. Looking for ideas or thoughts towards how I can go about it. Needing some help with this last part of my project.
Thanks for your time...
ASKER
Hey Ray,
Thanks for having a look, and for the sample code, and the article, as well as the links from before.
I have some more reading to do. Then I'm guessing, some questions to formulate. Then "I'll be back!". =)
"Build Your Own Database Driven Web Site Using PHP & MySQL, 4th Edition" looks very interesting! I think I will enjoy it as soon as I can work out getting a hold of it.
Carlos
Thanks for having a look, and for the sample code, and the article, as well as the links from before.
I have some more reading to do. Then I'm guessing, some questions to formulate. Then "I'll be back!". =)
"Build Your Own Database Driven Web Site Using PHP & MySQL, 4th Edition" looks very interesting! I think I will enjoy it as soon as I can work out getting a hold of it.
Carlos
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
If you want to hire an excellent freelancer programmer check for Monika Mathé
http://www.monikamathe.com/
she is an OSC Expert, as her for a quote
I have hire her as freelancer in the past.
http://www.monikamathe.com/
she is an OSC Expert, as her for a quote
I have hire her as freelancer in the past.
ASKER
Hello,
I apologize for my lack of involvement here. I had a baby girl, and had to hire someone to get this done for me.
Ray, thanks for all your input, and information. You're one of the good guys of this world. I'm leaving EE for now.
I apologize for my lack of involvement here. I had a baby girl, and had to hire someone to get this done for me.
Ray, thanks for all your input, and information. You're one of the good guys of this world. I'm leaving EE for now.
Thanks for the points and for your kind words, and CONGRATULATIONS! ~Ray
Before I start, though... getting the two systems to use a common login may not be hard, but it will probably require modifying the way one or both recognizes the logged in clients. What you want, in essence, is to take one of the registration and login sub-systems and use it for both systems. This applies to the forms, scripts, and DB tables. You might want to think about OAuth.
Cookies are HTTP headers set by the server and stored in the client "cookie jar". The client browser sends the cookies to the server on subsequent visits. In PHP, the cookies are found in $_COOKIE which is an associative array. Please see the code snippet for a teaching example script that shows how to set and view a cookie.
Sessions work (almost always) through cookies. The session id is a key to the session variables - these are stored in a temporary file on the server. When you start a session, you send a cookie to the browser. The information you put into the $_SESSION array is saved at the time of script termination (happens automatically) into the temporary file. When the next page of the web site executes session_start(), the session cookie is accessed, and its session id is used to locate the $_SESSION values.
I have an article here about login and logout processing that may be helpful to you.
https://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/A_2391-PHP-login-logout-and-easy-access-control.html
Best regards, ~Ray
Open in new window