CI 4 Session Iframe Protected |
I am trying to call an iframe of my site on CI4 with session control.
The session is set but when I switch to the controller I don't read the username variable. Code: <iframe id="iframeid" name="iframe" src="http://mysite.loc/?session_username=<?php echo $_SESSION['session_username'];?>&password=<?php echo $_SESSION['password'];?>" width="100%" height="500"/> Set Session: PHP Code: if (null !== $this->request->getVar("session_username")){ PHP Code: $this->session->set($Login); here if I read the session is read correctly. If I switch to another controller the session is no longer read, but only with iframe, if I use the main project with CI4 the session is read correctly. The other controller: PHP Code: if(isset($this->session->username)){ Do I have to set up the CI4 configuration specifically to use iframe ?? Code: id ip_address timestamp data I noticed that the session is reset and creates a new one. only with iframe. the first two. if I use the original project it creates only one session and is kept. The last one.
Asides from the issues with iframes, I was wondering if this was an urlencode issue?
Practical guide to IgnitedCMS - Book coming soon, www.ignitedcms.com
(04-06-2022, 12:13 PM)ignitedcms Wrote: Asides from the issues with iframes, I was wondering if this was an urlencode issue? I don't know much about urlencodes, but taking a look around is essentially passing variables to a certain function. From what I can see under the iframe, I lose the session and the data, it is as if it no longer communicates with the framework and creates a new instance. While if I use it from the codeigniter project everything works. Are you telling me I need to add index.php or change a path?
Modern browsers do not sent Cookie in iframe.
Is the site which has iframe the same site? CI4 set SameSite=Lax in Cookie. See https://github.com/codeigniter4/CodeIgni...e.php#L100 |
Welcome Guest, Not a member yet? Register Sign In |