Session variables not working php

后端 未结 10 1349
别跟我提以往
别跟我提以往 2020-11-22 03:12

Here are the code of my login page where the login script checks for the authenticity of the user and then redirects to inbox page using header function.

<         


        
相关标签:
10条回答
  • 2020-11-22 04:02

    I encountered this issue today. the issue has to do with the $config['base_url'] . I noticed htpp://www.domain.com and http://example.com was the issue. to fix , always set your base_url to http://www.example.com

    0 讨论(0)
  • 2020-11-22 04:06

    Maybe if your session path is not working properly you can try session.save_path(path/to/any folder); function as alternative path. If it works you can ask your hosting provider about default path issue.

    0 讨论(0)
  • 2020-11-22 04:06

    I had similar issue and with the cookie domain:

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

    the domain was setup wrong so all sessions were ignored because the user cookie was never set right hope this will help someone.

    0 讨论(0)
  • 2020-11-22 04:06

    I was also facing the same problem i did the following steps to resolve the issue

    1. I edited the file /etc/php.ini and searched the path session.save_path = "/var/lib/php/session" you have to give your session info

    2 After that just changed the permission given below *chown root.apache /var/lib/php/session * That's it. These above steps resolve my issue

    0 讨论(0)
提交回复
热议问题