Handle Session with URL Rewriting and Cookies
Posted: Fri Nov 28, 2008 5:20 am
I know that session handling in PHP by default is using Cookies. The application i am creating works perfectly with it, until new requirement come and force me to provide an URL which can be called by other server (without cookies) but session id in the URL (URL Rewriting) to access the session object.
My question are:
1. Does PHP support both and cookies by default, and if session is provided in URL then it uses URL Rewriting mechanism ?
2. I tried to get the session id from URL using this:
http://abc.com/myshop?sessionId=abcdex
(Where abcdex = session Id, session name is sessionId)
in the code
session_id($_GET['sessionId']);
session_start();
but i can't get the object in session abcdex.
Do i need to configure something, if yes, where? any good articles about this ?
Thank you so much in advance
My question are:
1. Does PHP support both and cookies by default, and if session is provided in URL then it uses URL Rewriting mechanism ?
2. I tried to get the session id from URL using this:
http://abc.com/myshop?sessionId=abcdex
(Where abcdex = session Id, session name is sessionId)
in the code
session_id($_GET['sessionId']);
session_start();
but i can't get the object in session abcdex.
Do i need to configure something, if yes, where? any good articles about this ?
Thank you so much in advance