Multi application and Session |
[eluser]Tacos[/eluser]
Hello, I would like to know if it's possible to share session information between multiple CodeIgniter application on the same root ? Thanks
[eluser]llbbl[/eluser]
Yes that is the definition and purpose of PHP sessions. http://www.w3schools.com/php/php_sessions.asp
[eluser]Tacos[/eluser]
Ok so I have to use native php session because when I use CodeIgniter session all my session information are reinizialized when I switch between two CodeIgniter application ... PS : I use multi application with the same CodeIgniter system
[eluser]Michael Wales[/eluser]
You can use the same session as long as they are hosted on the same domain and your config.php settings reflect that.
[eluser]Tacos[/eluser]
This is my cookie on App "A" : Code: Name : intranet This is my cookie on App "B" : Code: Name : intranet Sessions id are different between App A and App B ... When i reload my App A page the session id become the same than the App B session ... After that it works correctly, but when I switch for the first time to App B session is reinizialized Localhost can cause problems because it's not a real domain ? I don't have domain on my test machine ...
[eluser]llbbl[/eluser]
Your doing testing this locally? I have always been a big fan of test.example.com or what have you for testing.
[eluser]Tacos[/eluser]
This is all good now ! I recreate two new App with same config file and it works perfectly. Thanks a lot ! Bye
[eluser]PogiNate[/eluser]
If your two applications are on the same server, but not in the same directory, can you still use the CI sessions instead of the vanilla PHP sessions? How did you get that to work? I've just been asked to come up with a solution of this type and I would appreciate any help anyone can give! Thanks!
[eluser]Tacos[/eluser]
@PogiNate I don't use the CodeIgniter user guide method for multi application but this one instead. If you want to use CodeIgniter sessions in a multi application site you only have to use same cookies and sessions variables in each config.php file of each application : Code: $config['sess_cookie_name'] If you want to use encryption the key must be the same : Code: $config['encryption_key'] Hope it can help you.
|
Welcome Guest, Not a member yet? Register Sign In |