Jump to content

Session start causing a Notice.


ajoo

Recommended Posts

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.

 

Link to comment
Share on other sites

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 !

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.