Session lost after redirect in Codeigniter

前端 未结 13 2425
清歌不尽
清歌不尽 2021-02-05 06:39

I\'m using codeigniter as a framework.

Firstly, I use localhost but when I change to my IP address the login function doesn\'t work anymore. I found that th

13条回答
  •  无人共我
    2021-02-05 07:09

    Please check your links and make sure they are written correctly. When writing absolute URLs, make sure you add the 'www' part. This was the problem in my case. I hope this helps someone.


    Good: header("Location: http://www.yourdomain.com/controller/page");


    Bad (breaks your session): header("Location: http://yourdomain.com/controller/page");

提交回复
热议问题