Accessing encrypted session data in an external script - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Accessing encrypted session data in an external script (/showthread.php?tid=49820) |
Accessing encrypted session data in an external script - El Forum - 03-04-2012 [eluser]Unknown[/eluser] In order to connect Vanilla (forum software) with CI, I need to pass the user's id, name and email from CI to Vanilla. Therefore, I put the id of the user in a session, which is encrypted and stored in the database. But how can I, in an external script which is used by Vanilla for the authorization, access the data in the session? If I have the session_id I can look the data up in the database, but the session (and so the session_id) is encrypted... Accessing encrypted session data in an external script - El Forum - 03-04-2012 [eluser]Dede[/eluser] In "system\libraries" find "Encrypt.php". Change the Code: function get_key($key = '') so the $key variable holds the same encription_key as in your config.php (delete the $CI instances, as you cannot use them in external script). Then grab the session encoded string, and decode it, example: Code: require('include/Encript_modeified.php'); TEST!!!!! Accessing encrypted session data in an external script - El Forum - 03-05-2012 [eluser]Unknown[/eluser] Thanks, that worked! |