Xeoncross Posted April 6, 2008 Share Posted April 6, 2008 Ok, I build my $_SESSION's to use a MySQL database instead of flat files because 1) it is more secure and 2) it makes them available from any server than can access the DB. However, as of late I am questioning my choice. First, I have a API file that would run a LOT quicker if I didn't have to load my small DB abstraction layer and connect to the database just to use sessions for quick things like ajax requests. Second, I am trying to use a SWF unloader that ONLY sends $_FILE data and nothing more (sad really, no $_POST/$_GET data or anything!). So to solve the second problem I am trying to use javascript to add the session_id to the URL when the file is sent so I can just grab it from the URL, clean it, then set it as the current ID. <?php if (isset($_GET['PHPSESSID']) && sanitize_text($_GET['PHPSESSID'])) { session_id($_GET['PHPSESSID']); } ?> I am having trouble getting my idea to work. So my question is - Am I thinking about this the right way? Is there anything else that might make this easier? Quote Link to comment https://forums.phpfreaks.com/topic/99892-sessions-in-databases-instead-of-files/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.