ajoo Posted April 9, 2014 Share Posted April 9, 2014 Hi all, I am getting this Notice and I am unable to figure out why. Notice: Array to string conversion in D:\xampp\htdocs\xampp\MagicOn\functions\gen_functions.php on line 1084 Index.php calls the session start routine sec_session_start() which generates the error mentioned above. Line 1084 ( I have put the line number in the function against the line ) is indicated in the function sec_session_start() as the one which is calling session_start(). <?php //error_reporting(E_ALL & ~E_NOTICE); define('INCLUDE_CHECK',true); require 'loader.php'; sec_session_start(); $now = time(); . . . function sec_session_start() { $session_name = 'sec_session_id'; // Set a custom session name $secure = false; // Set to true if using https. $httponly = true; // This stops javascript being able to access the session id. ini_set('session.use_only_cookies', 1); // Forces sessions to only use cookies. $cookieParams = session_get_cookie_params(); // Gets current cookies params. session_set_cookie_params($cookieParams["lifetime"], $cookieParams["path"], $cookieParams["domain"], $secure, $httponly); // 0, /, ''. session_name($session_name); // Sets the session name to the one set above. 1084 session_start(); // Start the php session session_regenerate_id(TRUE); // regenerated the session, delete the old one. } ?> Grateful for any help. Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/287626-session-start-causing-a-notice/ Share on other sites More sharing options...
mac_gyver Posted April 9, 2014 Share Posted April 9, 2014 there's nothing technically wrong in the code you have shown that would (likely) cause that error. it would require referencing an array in a string context. are you sure that's the correct file at the drive letter and path mentioned in the error message? Quote Link to comment https://forums.phpfreaks.com/topic/287626-session-start-causing-a-notice/#findComment-1475456 Share on other sites More sharing options...
ajoo Posted April 10, 2014 Author Share Posted April 10, 2014 Hi thanks for the reply. Yes that's correct, the drive letter path and all and btw I managed to get rid of the error by just shutting down the machine once and starting it again. Yea just that. Without making a single change to the code. That error message seemed to have got stuck. So finally after many attempts at trying this n that I decided to shut down the browser and also the machine. It worked. Now the code is working and there are no messages. So the question is does anyone have any idea or has shared a similar experience whereby shutting the machine gets things going ? Any idea why this happens ? Thanks ! Quote Link to comment https://forums.phpfreaks.com/topic/287626-session-start-causing-a-notice/#findComment-1475667 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.