Session lost after redirect in Codeigniter

前端 未结 13 2751
清歌不尽
清歌不尽 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 06:48

    From my experience, the problems can be:

    1. one (or more) of your files ain't 'UTF-8 with BOM' (if your website won't be only English and use UTF-8 as encoding like mine). You must change all the files to 'UTF-8 with BOM'. Notepad++ will help.
    2. there are some characters before php tag or after ?> (better take ?> out). Please be sure there are no any characters include space.
    3. When call localhost/xxxxxx as the address, change it to 127.0.0.1/xxxxxx or your LAN IP
    4. I always store sessions in DB instead of file (easier for debuging).

提交回复
热议问题