skip to Main Content

I recently moved my website to a new server ( both are apache ).
the problem is that in this new server, the session cookie is not being set ( in addition to the XRF-token cookie ). but in my older host, they are just being set perfectly.
and I also noticed that the set-cookie header is not present ( but in the older host is present. )

Note that hosting moved my entire home directory, so none of my files have changed and the database ( my session driver ) works fine and stores sessions.

but cookies are not being set and as a result of that, I get 419 errors from the login page and other POST requests.

is there any configuration that I have to do in my new cPanel host or is there anything you think that I missed?
also tried clearing the cache and regenerating the app key. nothing worked.

2

Answers


  1. Session cookies may not be sent by Apache if some stray characters are output before the headers. This can happen if a file contains some text before the opening <?php. It can also happen (but less likely) if you close files with ?> This is bad practice and should be avoided.

    You would need to check your files carefully.

    You may be able to check if this might be the case by looking at the response from the server in your browser developer tools and see if there are any characters before what you would expect to be the first bytes of the response (eg <html )

    Login or Signup to reply.
  2. I also having the same issue.
    Solved by removing all die() commands that I put in.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search