You get a bonus - 1 coin for daily activity. Now you have 1 coin

session_start(); doesn't work and $_SESSION['emailsend'] isn't saved

Practice




session_start(); isn't working and $_SESSION['emailsend'] isn't being saved

check whether there is any text output (error messages or just a space in the php file) before session_start(); if there is, remove it and disable the output of all error messages with error_reporting(0);, also check what encoding the PHP file is saved in, and whether its encoding matches the one specified in the Header or in .htaccess

checked, the file starts without spaces


session_start();

check the syntax fully... whether there are () in session_start();

and so on

also check whether cookies are enabled, and if not, whether the session identifier is being passed in the get request? is it the same one?

thanks, indeed in some files I wasn't explicitly specifying the session identifier SID, while in others I was, but for some reason it was empty
INSTEAD OF

http://my-city.com.ua/?PHPSESSID=335365365601510f45
IT WROTE
http://my-city.com.ua/?SID ::haha.gif::

Yes, that happens
read here how this works

http://www.spravkaweb.ru/php/managfun/session/cookies

also check what the sessions are called, they're probably different,
and the variables for them are different too..

yes indeed the session id in one file is assigned forcibly,
and in the other randomly))) and probably the variables for them are different

Comments

To leave a comment

If you have any suggestion, idea, thanks or comment, feel free to write. We really value feedback and are glad to hear your opinion.
To reply

Lectures and tutorial on "Running server side scripts using PHP as an example (LAMP)"

Terms: Running server side scripts using PHP as an example (LAMP)