WebFaction
Community site: login faq

Im using PHP 5.6 on my localhost and 7 on webfaction.

When I try to logout from my application on localhost, its fine, but on webfaction, I get

Warning: session_destroy(): Session callback expects true/false return value in /home/username/webapps/app-name/app/Login.php on line 67

Warning: session_destroy(): Session object destruction failed in /home/username/webapps/app-name/app/Login.php on line 67

Line 67 in Login.php is session_destroy(); (It contains the code for logout too)

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

   session_destroy();

I checked http://php.net/manual/en/function.session-destroy.php - there hasn't been any change for PHP 7 - so why am I getting this warning ?

asked 22 Apr '16, 10:50

anjanesh
781032
accept rate: 16%


Is your 'session.save_path' set to your home directory? If not I would highly recommend creating a 'tmp' directory in your home directory and setting the sessions to be stored there. There should be no issue using session_destroy().

permanent link

answered 22 Apr '16, 11:53

aaront ♦♦
7664
accept rate: 27%

My sessions are stored in the database and in the file system. https://github.com/anjanesh/CB/blob/master/Session.php

(22 Apr '16, 13:29) anjanesh

Please open a support ticket so we can look at the issue directly on your account.

(22 Apr '16, 13:46) aaront ♦♦

My sessions are stored in the database and not in the file system.

(22 Apr '16, 15:41) anjanesh
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×9
×5

question asked: 22 Apr '16, 10:50

question was seen: 3,455 times

last updated: 22 Apr '16, 15:41

                              
WEBFACTION
REACH US
SUPPORT
LEGAL
© COPYRIGHT 2003-2021 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM