Jump to content

Recommended Posts

Yes. It must be at the very top of your code also.

 

 

<?php
session_start();
 
//now you can set session variables anywhere in the script.
?>

 

Kind regards,

 

L2c.

Edited by Love2c0de

I believe that you can put the session_start below the first line AS LONG AS you have no output to the browser before the session_start. If you have output to the browser then the header has already been sent and you get an error to that effect so it is usually good practice to put it right at the top.

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.