Can not initialise PHP session, please verify that your browser accepts cookies.

Can not initialise PHP session, please verify that your browser accepts cookies.

by Khvicha Chikhladze -
Number of replies: 5

I'm trying to install MOODLE v2.9+


During installation, after filling Administrator's Profile and clicking on 'Update Profile' button i'm getting this message: Can not initialise PHP session, please verify that your browser accepts cookies.


  • Cookies are enabled in my browser
  • All tests were passed by MOODLE during installation
  • Sessions folder is writable, in my 'php.ini' file (c:\windows\php.ini) session.save_path is "D:\Temp\PHP_Sessions\" but MOODLE writing session files under "D:\moodledata\sessions", anyway both folders are writable
  • All my own php scripts writing session files under "D:\Temp\PHP_Sessions\


OS: WIN 7 Ulitimate 64bit

WEB Server: APACHE 2.4.4 (Win64)

PHP: v5.5.0

DB: MySQL 5.6.12, account used in MOODLE is root

Web Browser: Chrome, Firefox

MOODLE WWW Folder: D:\Apache24\htdocs\moodle

MOODLE Data Folder: D:\moodledata

MOODLE Database: moodle, 250 tables without prefix

Hardware: CPU Intel i7-3632QM, RAM 8GB DDR3, SSD 250GB, HDD 750GB


Any suggestions how to solve this problem?

Average of ratings: -
In reply to Khvicha Chikhladze

Re: Can not initialise PHP session, please verify that your browser accepts cookies.

by Usman Asar -
Picture of Plugin developers Picture of Testers

Khvicha,

First thing, I do really admire your way of typing a post, very detailed!

Now coming to your issue, specially when using WAMP (Windows + Apache) (This combo you may never find on Production environment) when filling in admin details after installation, either screens gets blank or nothing seem to happen after you click submit button.

This usually happens when cache's get corrupted during install (again, I have only experienced this on a Windows + Apache combo), all you have to do is, go into your moodledata folder, and delete the "cache" and "localcache" folder, refresh browser and hopefully this issue will be resolved. Dont worry about deleting the folders as when you click refresh, they will automatically be re-created.

In reply to Usman Asar

Re: Can not initialise PHP session, please verify that your browser accepts cookies.

by Khvicha Chikhladze -

Usmar, thank You  for you reply, but I have already tried to delete "cache" and "localcache" folders:


1. delete folders and then refresh page where error was shown http://localhost/moodle/admin/index.php?sessionstarted=1&sessionverify=1&lang=en

2. delete folders and then click on "continue" button on the same page

3. delete folders and then refresh  Administrator Account's page http://localhost/moodle/user/editadvanced.php?id=2

4. fill Administrator Account Form, delete folders and then click on "Update profile" button


but still same error.

In reply to Khvicha Chikhladze

Re: Can not initialise PHP session, please verify that your browser accepts cookies.

by Usman Asar -
Picture of Plugin developers Picture of Testers

That is weird issue, must be something to do with php configuration file, but anyway, I am assuming, you have installed the XAMPP package, and on top of that installed Moodle files?

As in your case, I would have used windows installer package instead, as it comes with all underlying requirements intact, and they dont even run as service.
If you havent already, uninstall Apache/Php/MySQL (but save your php.ini) and try running Windows Installer package, and once you are up and ready, see how php.ini file is configured in installer package. 

Also, just as I was finishing this post, another thing popped up into my mind, have you declared PHP in environmental variables? Though I am assuming you would have already, but just in case.

In reply to Usman Asar

Re: Can not initialise PHP session, please verify that your browser accepts cookies.

by Khvicha Chikhladze -

Usman,

No, I'm not using XAMPP or WAMP, I have installed Apache/PHP/MySQL separately.


Yes, I know Windows installer package and don't have any problems with it on other PC, it works, i just wanted to prepare everything (on my WIN 7) to install MOODLE later on the real server (with Windows Server OS) where Apache/PHP/MySQL will be installed separately.


OK, as you said I will check 'php.ini' from Windows Installation Package and compare it with my 'php.ini'.


Yes, PHP is declared in environment variables.


Thank You anyway, will inform you as soon as i will have more info, Thank You Usman.

In reply to Usman Asar

Re: Can not initialise PHP session, please verify that your browser accepts cookies.

by Khvicha Chikhladze -

Solved !

As i found in 'php.ini' from Windows installer package was enable 'php_opcache' extension, but in my 'php.ini' it was not, as soon as i enable it error gone and i can finish installation.


Usman, do you know, is it possible to use MOODLE without 'php_opcache' extension?


Average of ratings: Useful (2)