Hello world,
I'm developing two applications:
1. Chat room
2. Forum
The two are under the same domain : chat_room.ask.com and forum.ask.com
What I wanna do is this, I want users who login to the forum to at the same time use the chat room without login in again...just like the google services.

Thank You.

Member Avatar for diafol

You need to share the session across subdomains.

There are quite a few ways to do this:

You can change settings in your php.ini file - if you have access to it. Otherwise you can use an ini_set(). Alternatively, use session_set_cookie_params() set to the main domain. The easiest way is probably to set a value in an .htaccess file:

php_value session.cookie_domain .ask.com
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.