SitePoint Sponsor |
|
User Tag List
Results 1 to 3 of 3
-
Dec 1, 2008, 08:20 #1
session.cookie_domain (question/problem)
Hi Guys,
I am trying to register my PHP session site-wide (all dirs and subdomains), but it does not seem to be working. Here is the scenario:
1) The session is being registered from https://secure.mydomain.com/clients
2) I also want the session to work in http://mydomain.com/domains
I am using the following ini_set at the top of my file (before session_start()):
PHP Code:ini_set('session.cookie_domain', '.mydomain.com');
PHP Code:ini_set('session.cookie_domain', 'mydomain.com');
Is this possible? Does it have anything to do with SSL?
-
Dec 2, 2008, 03:36 #2
- Join Date
- Oct 2007
- Posts
- 97
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Hi,
Yes it’s because of SSL, session and cookies created on https can not be access through http and visa versa.
Cheers,Maneet Puri
Lexolution IT Services
-
Dec 2, 2008, 07:12 #3
- Join Date
- May 2006
- Location
- Denmark
- Posts
- 407
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Try to set session.cookie_secure to false. By the way, there is a function for this.
Not entirely true. You cannot read cookies where secure=true on unencrypted connections, but you can read cookies where secure=false on both encrypted and unencrypted connections.
Bookmarks