The Everywhere Cloud

Deploy an instance.
Accelerate your application.

Solving Drupal 6 Login Problem in PHP

If users are unable to log into an existing Drupal 6 site after upgrading PHP, then the following steps may help resolve the issue.


1. In the Drupal folder, open the file that handles the user sessions.


2. Find the sess_regenerate() function and add the lines marked "After PHP upgrade" as follows.


 * Called when an anonymous user becomes authenticated or vice-versa.
function sess_regenerate() {
  global $user; //After PHP upgrade
  $old_session_id = session_id();

  // ...
  if (isset($_COOKIE[session_name()])) {
    setcookie(session_name(), '', time() - 42000, '/');

  $temp = $user; //After PHP upgrade
  $user = $temp; //After PHP upgrade

  db_query("UPDATE {sessions} SET sid = '%s' WHERE sid = '%s'", session_id(), $old_session_id);


3. Save the file, reload the page and log in.



Getting paid internationally?
Choose Payoneer.

Get started with DigitalOcean SSD Virtual Servers  Email Newsletters & Email Marketing by

Popular posts from this blog

Enabling HTTPS in Home Assistant

Running Home Assistant on FreeBSD Servers

Configuring the FreeBSD Firewall with IPFW