can't access $_SESSION in another file. Hand made captch - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: can't access $_SESSION in another file. Hand made captch (/showthread.php?tid=68562) |
can't access $_SESSION in another file. Hand made captch - glorsh66 - 07-28-2017 In a nutshell i making my own - very simple captcha, that does not use temp files. Just simple output image directly. In the view i just use this Code: <img src="../../myscripts/captcha.php" class="rounded-circle"/> And captcha itsef - Code: <?php Every thing is super fine, except it doesn't work☻ I mean it works fine only outside CI. The problem is - i can't accesses $_SESSION['expire'] - that i made in controller. (but it work perfectly fine if i use just another php file that lying around and is not a part of CodeIgniter). It seems that CI - makes another instance of session, if it is placed on another subdomain. Any thought? How can i pass parameters to this captcha.php file? RE: can't access $_SESSION in another file. Hand made captch - glorsh66 - 07-28-2017 I just solved my problem with captcha. I made additional controller (captcha controller) and in view make a link to the aforementioned controller <img src="http://testsite/Testcintroller" class="rounded-circle"/>. Because it is a controller it can access any data, including sessions. |