0

I have an issue with login session. Basically the flow is like this:

  • user creates account and defines a username;
  • user logins using url 'http://[username].website.com'
  • (coded in php & mysql, using session cookie)

My problem is: when trying to directly login from the index page 'www.website.com' I don't manage to get my user logged to his URL http://username.website.com

Let say i have opened url "www.example.com" and created a session variable in this url. Now i want to access that session variable in url "test.example.com". How to do that? any solution welcomed

Note: at the top of every php file i have used the below code but my session variable was destroyed and i can't access the session variable in another page. I have also set session.cookie_domain = ".website.com" on "php.ini" file.

ini_set('session.cookie_domain', '.website.com');

session_name("sessionid"); session_start();
Mark
  • 73
  • 8

1 Answers1

0

Try to put session_start() at the beginning? Remove all other lines and see what happens. It's difficult to diagnose without seeing the actual code.

Gang Su
  • 1,187
  • 10
  • 12