Access codeigniter session from external app |
[eluser]xpix[/eluser]
Hi, I have a website that uses an iframe to load a codeigniter app that sits on the same server. I need to access the codeigniter session variables in order to load different content in the iframe. For example I need to know the value of the $this->session->userdata('companylogin'). Thank you for your help PS:Any other ideas are welcomed
[eluser]WanWizard[/eluser]
If the two sites loaded share the same domain, you could use a domain cookie to pass information from one to the other. Not very secure though, so you have to take that into consideration. http://en.wikipedia.org/wiki/HTTP_cookie...ty_cookies also lists some alternatives that could be exploited, including a method that uses a field in the DOM that I think is quite clever...
[eluser]xpix[/eluser]
I think you gave me an idea I'm not sure but it might work this way: On page load I use ajax to load a file called ajax_is_company_logged_in.php or the equivalent using codeigniter path/url. If the answer is yea I replace a div in the DOM with the iframe. |
Welcome Guest, Not a member yet? Register Sign In |