i've sucsessefully set up .htacces to change all user.php?u=username links to username.website.com and it works perfectly.
Now, i'm having a problem with sessions on that part of the website. If i create a session on, eg /home (index.php) with value "test" it works on every other part (/home,/forum,/somethingelse) but it doesn't work on profile part (username.website.com), while it works if the url of profile is website.com/user/username or even user.php?u=username.
Does anyone know how to fix this ?
ps. php.ini :
session.use_cookies On
session.use_only_cookies On
session.cookie_path /
session.cookie_domain no value
session.cookie_domain = ".website.com"
php code
- Code: Select all
<?php
session_start();
//home.php
$_SESSION['username'] = "someusername";
?>
<?php
session_start();
//profile.php
echo $_SESSION['username'];
//output : nothing -.-
?>
<?php
session_start();
//forum.php
echo $_SESSION['username'];
//output : someusername
?>