hello, I have a question about a problem I have
I have a site http://www.mysite.com lets say.
I have another subdomain of it http://members.mysite.com/
on http://members.mysite.com/ users have a a login area. Everything works well, but when they visit http://www.mysite.com they are not logged in anymore. If they go back, they are logged in.
The scipt that checks for authentification is the main directory, and is included like include ("script.php")
Note that offline everuthying works great.
Also if a ueser loggs out, on http://www.myswite.com/logout.php if they go back on members.mysite.com they appear as logged in
Any ideea about the prb?
Thx
authentification prolem
Moderator: General Moderators
- Think Pink
- Forum Contributor
- Posts: 106
- Joined: Mon Aug 02, 2004 3:29 pm
- Think Pink
- Forum Contributor
- Posts: 106
- Joined: Mon Aug 02, 2004 3:29 pm
Then the session_id probably (by default) is transfered as cookie.
Take a look atin your php.ini.
Both subdomains are handled by the same webserver?
Take a look at
The client will not send a cookie for the domain http://www.mysite.com with the request to members.mysite.comhttp://de2.php.net/session wrote:session.cookie_domain string
session.cookie_domain specifies the domain to set in session_cookie. Default is none at all meaning the host name of the server which generated the cookie according to cookies specification. See also session_get_cookie_params() and session_set_cookie_params().
tryhttp://wp.netscape.com/newsref/std/cookie_spec.html wrote: domain=DOMAIN_NAME
When searching the cookie list for valid cookies, a comparison of the domain attributes of the cookie is made with the Internet domain name of the host from which the URL will be fetched. If there is a tail match, then the cookie will go through path matching to see if it should be sent. "Tail matching" means that domain attribute is matched against the tail of the fully qualified domain name of the host. A domain attribute of "acme.com" would match host names "anvil.acme.com" as well as "shipping.crate.acme.com".
Code: Select all
session.cookie_domain=mysite.comBoth subdomains are handled by the same webserver?
- Think Pink
- Forum Contributor
- Posts: 106
- Joined: Mon Aug 02, 2004 3:29 pm
session.cookie_domain is marked as PHP_INI_ALL. You should be able to change the value even from within the php script (before session_start() is called)
Code: Select all
<?php
error_reporting(E_ALL);
ini_set('session.cookie_domain', 'mysite.com');
session_start();- Think Pink
- Forum Contributor
- Posts: 106
- Joined: Mon Aug 02, 2004 3:29 pm