Welcome Guest, Not a member yet? Register   Sign In
Transfering sessions across domains
#5

[eluser]simshaun[/eluser]
You could send the session_id in the url across the domains (only needs to be done once).

Although this opens up the possibility for session hijacking, it's the only way I know.

Also, I think you have to use PHP's native session library instead of CI's, because AFAIK you can't tell CI's what session_id to use when starting the session.

Example:

Domain A -
Code:
$sess_id = session_id();
$this->output->set_header("Location: http://www.website2.com/file.php?sid=" . $sess_id);

Domain B -
Code:
if ($this->input->get('sid') !== FALSE){
    // You might want to perform some simple validation here.
    session_id($this->input->get('sid'));
    session_start();

    // If you want to get the SID out of the url, you need to "refresh" the page here with another Location header (or use the URL helper's "redirect" method).
}


Messages In This Thread
Transfering sessions across domains - by El Forum - 11-17-2008, 09:32 AM
Transfering sessions across domains - by El Forum - 11-17-2008, 10:29 AM
Transfering sessions across domains - by El Forum - 11-17-2008, 12:26 PM
Transfering sessions across domains - by El Forum - 12-30-2008, 05:58 AM
Transfering sessions across domains - by El Forum - 12-30-2008, 10:44 AM
Transfering sessions across domains - by El Forum - 12-30-2008, 11:47 AM
Transfering sessions across domains - by El Forum - 12-30-2008, 01:19 PM
Transfering sessions across domains - by El Forum - 12-30-2008, 01:30 PM
Transfering sessions across domains - by El Forum - 12-30-2008, 01:42 PM
Transfering sessions across domains - by El Forum - 12-30-2008, 01:45 PM
Transfering sessions across domains - by El Forum - 12-30-2008, 01:54 PM
Transfering sessions across domains - by El Forum - 12-30-2008, 01:57 PM
Transfering sessions across domains - by El Forum - 12-30-2008, 01:58 PM
Transfering sessions across domains - by El Forum - 12-30-2008, 02:02 PM
Transfering sessions across domains - by El Forum - 12-31-2008, 07:28 AM



Theme © iAndrew 2016 - Forum software by © MyBB