PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
sazzad
Forum Newbie
Posts: 5 Joined: Sun Jul 18, 2004 12:09 am
Location: Dhaka, Bangladesh
Post
by sazzad » Sun Jul 18, 2004 12:09 am
hello,
can anyone tell me how can i use my session in multiple subdomain.
I use this code to register my session.
<?php
session_start();
$_SESSION['id'] = "1";
$_SESSION['username'] = "username";
$_SESSION['password'] = "password";
?>
but it does not work in subdomain. I wan to use this session in subdomain.
??????????
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Sun Jul 18, 2004 12:12 am
make sure the cookie is set with a domain of .mydomain.com and a path of /
yes that is a dot in front of mydomain.com
sazzad
Forum Newbie
Posts: 5 Joined: Sun Jul 18, 2004 12:09 am
Location: Dhaka, Bangladesh
Post
by sazzad » Sun Jul 18, 2004 12:26 am
How can i set my cookie with domain ???
Do you have any example????
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Sun Jul 18, 2004 12:27 am
[php_man]setcookie[/php_man]
sazzad
Forum Newbie
Posts: 5 Joined: Sun Jul 18, 2004 12:09 am
Location: Dhaka, Bangladesh
Post
by sazzad » Sun Jul 18, 2004 12:32 am
Actually I do not want to use cookie.
Is there any why with using SESSION ?????
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Sun Jul 18, 2004 12:35 am
yours is using a cookie..
sazzad
Forum Newbie
Posts: 5 Joined: Sun Jul 18, 2004 12:09 am
Location: Dhaka, Bangladesh
Post
by sazzad » Sun Jul 18, 2004 12:39 am
oppps
Thank you feyd for your help.
sazzad
Forum Newbie
Posts: 5 Joined: Sun Jul 18, 2004 12:09 am
Location: Dhaka, Bangladesh
Post
by sazzad » Sun Jul 18, 2004 1:07 am
my code working now.
Thanks again feyd.