Hi.
Working with PHP 4, I want to manage sessions for users visiting 'mydomain2.com' by using a PHP script within 'mydomain1.com' (They both are in the same web server)
I find some problems, cause 'mydomain1.com' script doesn't identify user visiting 'mydomain2.com'. I tried to use
-------
php_value session.cookie_domain "mydomain1.com"
------
within 'mydomain2.com' Apache configuration, but it doesn't work (I suppose it doesn't anything to do with cookies, right?).
Any suggestion is appreciated. Thank you very much.
Managing session of 'mydomain2.com' from 'mydomain1.com'
Moderator: General Moderators
- DaveTheAve
- Forum Contributor
- Posts: 385
- Joined: Tue Oct 03, 2006 2:25 pm
- Location: 127.0.0.1
- Contact:
Web Dummy is right, this is NOT the correct form to post your question; none-the-less, I will answer your question.
Save your session data to a database NOT via cookies and draw your session information that way.
Although their are many ways to go about this, the CLEANEST but larger way, I think would be three databases: one for mydomainone.com, one for mydomaintwo.com, and one for your session data. The next step is to create, or obtain a pre-made, class that will handle your session data and store it in a database and extract it. Of course for your system to know what session to use your would need to use a cookie, although, PHP's default session handler does the same thing; just make sure you run the session ID from the cookie into a database sanitizer first.
Save your session data to a database NOT via cookies and draw your session information that way.
Although their are many ways to go about this, the CLEANEST but larger way, I think would be three databases: one for mydomainone.com, one for mydomaintwo.com, and one for your session data. The next step is to create, or obtain a pre-made, class that will handle your session data and store it in a database and extract it. Of course for your system to know what session to use your would need to use a cookie, although, PHP's default session handler does the same thing; just make sure you run the session ID from the cookie into a database sanitizer first.