Jump to content

Login system doesn't log me in


dannon

Recommended Posts

the code you posted for putting the dot in front of the domain parameter was shown for a session_set_cookie_params() statement. did you do the same for the set_cookie() statement?

 

and, if this problem is because of url's having/not having the hostname in front of the domain name, you should be -

 

A) consistent in your coding throughout your site

 

B) have a redirect in your .htaccess file to send all requests to one hostname variation of your domain name.

Edited by mac_gyver
Link to comment
Share on other sites

the code you posted for putting the dot in front of the domain parameter was shown for a session_set_cookie_params() statement. did you do the same for the set_cookie() statement?

 

and, if this problem is because of url's having/not having the hostname in front of the domain name, you should be -

 

A) consistent in your coding throughout your site

 

B) have a redirect in your .htaccess file to send all requests to one hostname variation of your domain name.

 

Yea, I put a dot before the domain for all of my cookies now, I use this: where DOMAIN, is set to my website's domain name (example.com).

        $domain = ($_SERVER['HTTP_HOST'] == "localhost." ? false : "." . DOMAIN);

I have made it so my .htaccess redirects to the URL without the "www.".

 

I have also made sure that my website only redirects to URLs without a www. 

 

It still breaks.

Edited by dannon
Link to comment
Share on other sites

I have found that if I remove the PHPSESSID cookie and spam click on a link, the cookie breaks.

Has this been causing the issue all along? Are there too many requests sent while the session isn't properly set or something? and the cookie isn't set on the client, while the website thinks it's updated? 

 

UmpOi.gif

 

If so, is it possible to fix this?

Edited by dannon
Link to comment
Share on other sites

I'm going to make it so it checks the last 5 cookie tokens from the database instead of the last cookie. Is it possible to make sure that only 5 tokens of 1 user_id exists in the database? Could someone help me rewrite a query for this?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.