Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 195
  • Last Modified:

SESSIONS and URLS

How can you make PHP/Apache know that www.domain.com and domain.com can share sessions.  It's annoying how you write this code to deal with sessions for your site, www.domain.com and if someone types it in without the www the session data is not accessable.  I am sure there is a clean way, but it escapes me at the moment.  Help out!

Andy
0
tha_mink
Asked:
tha_mink
1 Solution
 
German_RummCommented:
Hi tha_mink,

You need to change session.cookie_domain to your domain, for example ".domain.com".
You can set it using php.ini, or .htaccess or inside your script - ini_set('session.cookie_domain', 'yourdomain.com')


---
German Rumm.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now