RE: sessions vs domain problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

As far as I know, the session will use a cookie, and the cookies are linked to one domain name.
I don't know a way of using a cookie accross multiple domains, but I guess this should be possible.
The question is : will PHP allow you to do that? I guess no because this could be a security issue...

maybe someone in the list can help.

search the web for the cookie accross multipple domain.

Vincent
(greetings from Belgium !!)


-----Original Message-----
From: Reinhart Viane [mailto:rv@xxxxxxxx]
Sent: Fri 22/12/2006 12:52
To: php-general@xxxxxxxxxxxxx
Subject:  sessions vs domain problem
 
Hello,

 

I have the folowing problem :

Hosting of my site is at http://www.groep6049.ksjnet.be
<http://www.groep6049.ksjnet.be/> 

My domainname is www.ksachiropoelkapelle.be
<http://www.ksachiropoelkapelle.be/> 

 

I have forwarded www.ksachiropoelkapelle.be
<http://www.ksachiropoelkapelle.be/>  towards
http://www.groep6049.ksjnet.be/index.php

I use cloaked forwarding (so ksachiropoelkapelle stays in the address bar)

 

Now people can log in on that site:

 

$sql="select * from users where user_firstname='$firstname' and
user_password='$password'";

$result=mysql_query($sql) or die(mysql_error());

$count=mysql_num_rows($result);

if ($count>0) {

            $row=mysql_fetch_array($result);

            $userid=$row["user_id"];

            $gebruikersnaam=$row["user_firstname"];

            //set the session variables

            $_SESSION['userid']=$userid;

            $_SESSION['gebruikersnaam']=$gebruikersnaam; 

            

            header("Location: http://www.ksachiropoelkapelle.be/index.php";);

}

 

The problem is:

When I surf directly to http://www.ksachiropoelkapelle.be
<http://www.ksachiropoelkapelle.be/>  and try to login nothing happens. The
script is executed successfully but it does not seem to recognize the
$_SESSION to show that I'm logged in.

When I surf to http://www.groep6049.ksjnet.be/index.php and try to login it
works perfectly.

 

Is it possible to set something extra in my php session variables to make it
work when surfing directly to http://www.ksachiropoelkapelle.be
<http://www.ksachiropoelkapelle.be/>  ?

Or do I have to disable the cloaking?

 

Thanks in advance,

 

Reinhart Viane

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux