Álvaro G. Vicario wrote:
> pek escribió:
>> OK, I've been having this problem for quite some time but never until
>> now I really needed a solution. I have never thought of a work around,
>> so I really need your help. Sorry if this has been mentioned already.
>> You can point me to the post and I'll gladly read. I googled this a
>> lot but, first, most people have tutorials for sharing sessions in
>> subdomains, and, second, I have no clue what keywords to use.
>>
>> I am currently developing two web sites in my localhost. The first one
>> is http://localhost/pageone and the other http://localhost/pagetwo. I
>> have a login script for each. The login script can either be session
>> based (for temporary logins) or cookie based (for long term logins).
>>
>> When I login in one site, I create two session variables named user
>> and key which store a user name and a random 128 characters string.
>> The key is stored in the database and changes upon each login (a
>> little security). After successfully logging in in pageone using
>> sessions, I noticed that in pagetwo I am also logged in. So I added a
>> session variable "domain" which I check on both pages to see if the
>> session information is for the right page. Although this works, I
>> found that now I can only be logged in in one page at a time. I am
>> assuming that sessions are shared.
>
> Sessions are shared between all hosted sites unless you change it but it
> shouldn't be an issue. Your problem is with cookies. It's pointless to
> specify a *domain* in setcookie() because both sites are in the same
> domain (localhost). What you need to specify is a *path*.
>
> Same applies to session_set_cookie_params().
>
>
Incorrect. Cookies, which are used to manage sessions, are domain
specific. A browser will not send a cookie to another domain,
irregardless of the host.
In this case both are on "localhost", so the domain is the same.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================