CodeIgniter Forums
missing data after redirect - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Development (https://forum.codeigniter.com/forumdisplay.php?fid=6)
+--- Forum: CodeIgniter 2.x (https://forum.codeigniter.com/forumdisplay.php?fid=18)
+--- Thread: missing data after redirect (/showthread.php?tid=73365)



missing data after redirect - laraigniter - 04-16-2019

I have an old CI 2 project back to '11. My task was to change http to https. The frontend works well, but at backend I have problems. Step by step process:
- at the login controller the user successfully logs in (I use DX_Auth auth library) it puts all data (username, user_id, logged_in etc) to session. I debugged, all data are there.
- after positive login there's a redirect to admin/index page. like redirect('admin/index');
- here in the constructor is a login check, but the check fails because nothing in the session previously put into it.
it seems that somehow at redirect these data are losing..   Dodgy

Two facts:
1. it was working before changing to https
2. this project is set up on my computer using MAMP, the login and redirect into admin works also well. Huh

I see in CI 3 docs, that redirect() has a second parameter, like 'https'. Maybe that's the solution, or?

Any idea?
Thanks


RE: missing data after redirect - php_rocs - 04-16-2019

@laraigniter,

Have you checked all CI 2.x configurations? Have you done a search to see if there are any hard coded http? What pages or sections are having https issues? Have you checked the views and controllers for hard coded http settings?


RE: missing data after redirect - laraigniter - 04-17-2019

(04-16-2019, 08:01 AM)php_rocs Wrote: @laraigniter,

Have you checked all CI 2.x configurations?  Have you done a search to see if there are any hard coded http?  What pages or sections are having https issues? Have you checked the views and controllers for hard coded http settings?

hi,
do you mean every page of the site? because now I'm testing the login part, there aren't http links, but on the article listing part there can be some because users-added links come from DB, and they used full url-s to link to own articles.. I'm on the way fixing that. 
It can be a problem during auth cont. -> admin cont. redirection?

In config, I set https base_url, cookie to secure. I store sessions in DB.

I'm curious if maybe the redirect method can be a problem, in CI 3 docs I see a spec. param for setting https. Somehow the session variables are missing. 

When I dump the all_userdata on my MAMP local system, after redirection to admin page, I see all the DX_ auth related variables like DX_logged_in = true , etc.

Dumping on live site, I get only the public part of the session, not the extra..


RE: missing data after redirect - php_rocs - 04-17-2019

@laraigniter,

There are tools that can determine if there are hardcoded http in the code. Most basic IDE's have the ability to search the project files. Also, do you have any debugging tools to help you resolve the issue?