Page 1 of 1

Can't log in as admin after install? Possible solution...

Posted: Fri Jun 30, 2006 6:19 am
by lalldrin
I banged my head for hours trying to figure out why a fresh install of CMSMS .13 on my production server wouldn't work, while the CMS worked fine on an "identically" configured dev server.

Turns out the servers were NOT configured the same, and the problem turned out to be in my php.ini file. The session.cookie_domain value was blank on my dev server, and set to a fully-qualified domain (i.e. 'www.somewhere.com') on my production server. The subdomain I was installing CMSMS in on the production server was NOT the same as that listed in php.ini. Relaxing the session.cookie_domain value to '.somewhere.com' fixed the problem.

In short, cookies were not making it to the browser. If you get stuck in a loop trying to log into the admin area (and are not getting a bad password message), scrutinize your cookie handling. Odds are your server is not generating cookies, or your browser is not accepting them.

Good luck.

Re: Can't log in as admin after install? Possible solution...

Posted: Mon Jul 31, 2006 3:25 pm
by mcfoggy
Hi,

I have exactly the same problem but i cannot have access to the php.ini file, i am hosted on a server and do not have enough rights on it.

Did someone find a solution ?

Thanks a lot for your help.

Re: Can't log in as admin after install? Possible solution...

Posted: Tue Aug 01, 2006 8:02 pm
by Elijah Lofgren
mcfoggy wrote: Hi,

I have exactly the same problem but i cannot have access to the php.ini file, i am hosted on a server and do not have enough rights on it.

Did someone find a solution ?

Thanks a lot for your help.
This may work:
1. Open include.php and add the following 3 lines to the top of the file just after the "<?php"

Code: Select all

$dirname = dirname(__FILE__);
session_set_cookie_params(0 , '/', $_SERVER['HTTP_HOST']);
session_save_path($dirname.'/tmp/cache');
The top of the file should then look like this:

Code: Select all

<?php
$dirname = dirname(__FILE__);
session_set_cookie_params(0 , '/', $_SERVER['HTTP_HOST']);
session_save_path($dirname.'/tmp/cache');

#CMS - CMS Made Simple
Let us know if this fixes your problem and maybe we can add a workaround similar to this for people that run into your problem.

Thanks,

Elijah

Re: Can't log in as admin after install? Possible solution...

Posted: Mon Jul 28, 2008 10:45 pm
by marlowmusic
That did it for me! Yes please include that piece of code in the next version.