Handle Session with URL Rewriting and Cookies

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
php_b00n
Forum Newbie
Posts: 2
Joined: Fri Nov 28, 2008 5:08 am

Handle Session with URL Rewriting and Cookies

Post by php_b00n »

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
php_b00n
Forum Newbie
Posts: 2
Joined: Fri Nov 28, 2008 5:08 am

Re: Handle Session with URL Rewriting and Cookies

Post by php_b00n »

Anyone? PHP Guru ?
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Handle Session with URL Rewriting and Cookies

Post by requinix »

Check your php.ini settings to see how sessions are handled. If that's hard to do, phpinfo() will tell you the same information.
Post Reply