wingchunnt Posted October 5, 2015 Share Posted October 5, 2015 So, I'm in the php file where I'm in the middle of configuring my 'cookie_domain' and my 'cookie_path'.This is what I have I have:define('COOKIE_DOMAIN','_____________');define('COOKIE_PATH','______________');I've left the slots blank for the purpose of this question. In the first one I placed 'http://localhost' which I'm not sure is correct. I have absolutely no idea what to place in the next one. The reason I'm asking is because when I login with a user it is redirecting me to the homepage and it's also not allowing me to create new post. It seems to me that I'm loosing the funcationality due to the cookies not being configured properly.Can anyone assist me? Quote Link to comment Share on other sites More sharing options...
wingchunnt Posted October 5, 2015 Author Share Posted October 5, 2015 it's as if it's not remembering that a user has signed in... Quote Link to comment Share on other sites More sharing options...
mac_gyver Posted October 5, 2015 Share Posted October 5, 2015 (edited) if the two values are being used in a setcookie() or a session_set_cookie_params() statement or in individual ini_set() statements for the session cookie parameters, the first one means the variations of the domain that the cookie will match and the second one is the path after the domain that the cookie will match. you can find specific information about these two settings in the php.net documentation for the setcookie() or session_set_cookie_params() statements. http:// is not part of a domain. it's a protocol and would not be part of the cookie settings. the path would typically be a / to match all paths after the domain. do you have php's error_reporting set to E_ALL and display_errors set to ON so that php will help you by reporting and displaying all the errors it detects? this is usually the first step that helps pin down what is causing a problem. Edited October 5, 2015 by mac_gyver Quote Link to comment Share on other sites More sharing options...
Jacques1 Posted October 5, 2015 Share Posted October 5, 2015 Before you randomly change the cookie settings, you should investigate the problem and figure out what's really going on. Who says it's a cookie problem? It could be pretty much anything. What does var_dump($_SESSION); tell you? Is the session in the target script entirely empty? Modern browsers also come with developer tools (usually accessible via F12). Clear all session cookies, then try to log in. Does the server send a session cookie? Does your browser send it back when visiting the target script? Quote Link to comment Share on other sites More sharing options...
wingchunnt Posted October 5, 2015 Author Share Posted October 5, 2015 I diddefine('COOKIE_DOMAIN','.localhost');define('COOKIE_PATH','/');and it worked like a charm. I honestly intuitively thought it was a cookie probelm = / ....I'm new to this by the way Quote Link to comment Share on other sites More sharing options...
Jacques1 Posted October 5, 2015 Share Posted October 5, 2015 So who broke the original cookie parameters, and what are the values before you override them? It's not normal that you have to reset the parameters in every single script. This should be fixed on a higher level like the global php.ini or a custom ini file or an .htaccess file. Quote Link to comment Share on other sites More sharing options...
wingchunnt Posted October 5, 2015 Author Share Posted October 5, 2015 it was set up in a configure file. Containing SMTP settings, database username/password settings, base url setting, default templates and cookie settings as well.I previously checked the php.ini and .htacess and they seemed fine. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.