Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Activated my SSL now I can't login to my admin account


Guest

Recommended Posts

I recently realized my SSL was not tied to my site so I did some research and figured out how to fix it (or so I thought). I modified my includes/configure.php and my admin/includes/configure.php files. I logged into a test customer account I created and voila https. Then I went to login to my admin and got this message at the top of my admin login page:

 

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/n9vapo5/public_html/dwd/includes/configure.php:34) in /home/n9vapo5/public_html/dwd/includes/functions/sessions.php on line 102

 

I never modified the sessions.php file. I'm not exactly sure what I did that caused this issue. The front end of my store still appears to be functioning properly, but I can't get to the back-end, so I can't check for orders or do any admin functions which is no bueno. Does anybody have any ideas? I checked line 102 in the sessions.php file and did not see anything out of the ordinary, but I'm not sure I'd know if something was wrong even if I was staring right at it. I'll post the configure.php files and the sessions.php for your scrutiny.

 

includes/configure.php:

 

<?php

define('HTTP_SERVER', 'http://www.99vapors.com');

define('HTTPS_SERVER', 'https://www.99vapors.com');

define('ENABLE_SSL', true);

define('HTTP_COOKIE_DOMAIN', 'www.99vapors.com');

define('HTTPS_COOKIE_DOMAIN', 'www.99vapors.com');

define('HTTP_COOKIE_PATH', '/');

define('HTTPS_COOKIE_PATH', '/');

define('DIR_WS_HTTP_CATALOG', '/');

define('DIR_WS_HTTPS_CATALOG', '/');

define('DIR_WS_IMAGES', 'images/');

define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/');

define('DIR_WS_INCLUDES', 'includes/');

define('DIR_WS_BOXES', DIR_WS_INCLUDES . 'boxes/');

define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/');

define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/');

define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/');

define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES . 'languages/');

 

define('DIR_WS_DOWNLOAD_PUBLIC', 'pub/');

define('DIR_FS_CATALOG', '/home/n9vapo5/public_html/');

define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/');

define('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG . 'pub/');

 

define('DB_SERVER', 'localhost');

define('DB_SERVER_USERNAME', 'n9vapo5_dunweb');

define('DB_SERVER_PASSWORD', 'Dunweb1');

define('DB_DATABASE', 'n9vapo5_shop');

define('USE_PCONNECT', 'false');

define('STORE_SESSIONS', 'mysql');

?>

 

 

 

dwd/includes/configure.php (dwd is the name of my admin folder in my installation):

 

<?php

define('HTTP_SERVER', 'http://www.99vapors.com');

define('HTTP_CATALOG_SERVER', 'http://www.99vapors.com');

define('HTTPS_CATALOG_SERVER', 'http://www.99vapors.com');

define('ENABLE_SSL_CATALOG', 'false');

define('DIR_FS_DOCUMENT_ROOT', '/home/n9vapo5/public_html/');

define('DIR_WS_ADMIN', '/dwd/');

define('DIR_FS_ADMIN', '/home/n9vapo5/public_html/dwd/');

define('DIR_WS_CATALOG', '/');

define('DIR_FS_CATALOG', '/home/n9vapo5/public_html/');

define('DIR_WS_IMAGES', 'images/');

define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/');

define('DIR_WS_CATALOG_IMAGES', DIR_WS_CATALOG . 'images/');

define('DIR_WS_INCLUDES', 'includes/');

define('DIR_WS_BOXES', DIR_WS_INCLUDES . 'boxes/');

define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/');

define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/');

define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/');

define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES . 'languages/');

define('DIR_WS_CATALOG_LANGUAGES', DIR_WS_CATALOG . 'includes/languages/');

define('DIR_FS_CATALOG_LANGUAGES', DIR_FS_CATALOG . 'includes/languages/');

define('DIR_FS_CATALOG_IMAGES', DIR_FS_CATALOG . 'images/');

define('DIR_FS_CATALOG_MODULES', DIR_FS_CATALOG . 'includes/modules/');

define('DIR_FS_BACKUP', DIR_FS_ADMIN . 'backups/');

 

define('DB_SERVER', 'localhost');

define('DB_SERVER_USERNAME', 'n9vapo5_dunweb');

define('DB_SERVER_PASSWORD', 'Dunweb1');

define('DB_DATABASE', 'n9vapo5_shop');

define('USE_PCONNECT', 'false');

define('STORE_SESSIONS', 'mysql');

?>

 

dwd/includes/functions/sessions.php:

 

<?php

/*

$Id: sessions.php 1830 2008-01-30 00:58:21Z hpdl $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2008 osCommerce

 

Released under the GNU General Public License

*/

 

if ( (PHP_VERSION >= 4.3) && ((bool)ini_get('register_globals') == false) ) {

@ini_set('session.bug_compat_42', 1);

@ini_set('session.bug_compat_warn', 0);

}

 

if (STORE_SESSIONS == 'mysql') {

if (!$SESS_LIFE = get_cfg_var('session.gc_maxlifetime')) {

$SESS_LIFE = 1440;

}

 

function _sess_open($save_path, $session_name) {

return true;

}

 

function _sess_close() {

return true;

}

 

function _sess_read($key) {

$value_query = tep_db_query("select value from " . TABLE_SESSIONS . " where sesskey = '" . tep_db_input($key) . "' and expiry > '" . time() . "'");

$value = tep_db_fetch_array($value_query);

 

if (isset($value['value'])) {

return $value['value'];

}

 

return '';

}

 

function _sess_write($key, $val) {

global $SESS_LIFE;

 

$expiry = time() + $SESS_LIFE;

$value = $val;

 

$check_query = tep_db_query("select count(*) as total from " . TABLE_SESSIONS . " where sesskey = '" . tep_db_input($key) . "'");

$check = tep_db_fetch_array($check_query);

 

if ($check['total'] > 0) {

return tep_db_query("update " . TABLE_SESSIONS . " set expiry = '" . tep_db_input($expiry) . "', value = '" . tep_db_input($value) . "' where sesskey = '" . tep_db_input($key) . "'");

} else {

return tep_db_query("insert into " . TABLE_SESSIONS . " values ('" . tep_db_input($key) . "', '" . tep_db_input($expiry) . "', '" . tep_db_input($value) . "')");

}

}

 

function _sess_destroy($key) {

return tep_db_query("delete from " . TABLE_SESSIONS . " where sesskey = '" . tep_db_input($key) . "'");

}

 

function _sess_gc($maxlifetime) {

tep_db_query("delete from " . TABLE_SESSIONS . " where expiry < '" . time() . "'");

 

return true;

}

 

session_set_save_handler('_sess_open', '_sess_close', '_sess_read', '_sess_write', '_sess_destroy', '_sess_gc');

}

 

function tep_session_start() {

global $HTTP_GET_VARS, $HTTP_POST_VARS, $HTTP_COOKIE_VARS;

 

$sane_session_id = true;

 

if (isset($HTTP_GET_VARS[tep_session_name()])) {

if (preg_match('/^[a-zA-Z0-9]+$/', $HTTP_GET_VARS[tep_session_name()]) == false) {

unset($HTTP_GET_VARS[tep_session_name()]);

 

$sane_session_id = false;

}

} elseif (isset($HTTP_POST_VARS[tep_session_name()])) {

if (preg_match('/^[a-zA-Z0-9]+$/', $HTTP_POST_VARS[tep_session_name()]) == false) {

unset($HTTP_POST_VARS[tep_session_name()]);

 

$sane_session_id = false;

}

} elseif (isset($HTTP_COOKIE_VARS[tep_session_name()])) {

if (preg_match('/^[a-zA-Z0-9]+$/', $HTTP_COOKIE_VARS[tep_session_name()]) == false) {

$session_data = session_get_cookie_params();

 

setcookie(tep_session_name(), '', time()-42000, $session_data['path'], $session_data['domain']);

 

$sane_session_id = false;

}

}

 

if ($sane_session_id == false) {

tep_redirect(tep_href_link(FILENAME_DEFAULT, '', 'NONSSL', false));

}

 

return session_start();

}

 

function tep_session_register($variable) {

if (PHP_VERSION < 4.3) {

return session_register($variable);

} else {

if (isset($GLOBALS[$variable])) {

$_SESSION[$variable] =& $GLOBALS[$variable];

} else {

$_SESSION[$variable] = null;

}

}

 

return false;

}

 

function tep_session_is_registered($variable) {

if (PHP_VERSION < 4.3) {

return session_is_registered($variable);

} else {

return isset($_SESSION) && array_key_exists($variable, $_SESSION);

}

}

 

function tep_session_unregister($variable) {

if (PHP_VERSION < 4.3) {

return session_unregister($variable);

} else {

unset($_SESSION[$variable]);

}

}

 

function tep_session_id($sessid = '') {

if ($sessid != '') {

return session_id($sessid);

} else {

return session_id();

}

}

 

function tep_session_name($name = '') {

if ($name != '') {

return session_name($name);

} else {

return session_name();

}

}

 

function tep_session_close() {

if (PHP_VERSION >= '4.0.4') {

return session_write_close();

} elseif (function_exists('session_close')) {

return session_close();

}

}

 

function tep_session_destroy() {

return session_destroy();

}

 

function tep_session_save_path($path = '') {

if ($path != '') {

return session_save_path($path);

} else {

return session_save_path();

}

}

?>

Link to comment
Share on other sites

When I actually hit the button to login I get this:

 

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/n9vapo5/public_html/dwd/includes/configure.php:34) in /home/n9vapo5/public_html/dwd/includes/functions/sessions.php on line 102

 

Warning: Cannot modify header information - headers already sent by (output started at /home/n9vapo5/public_html/dwd/includes/configure.php:34) in /home/n9vapo5/public_html/dwd/includes/functions/general.php on line 22

Link to comment
Share on other sites

Headers Already Sent

 

Click the link above for an explanation.

 

The problem is in /dwd/includes/configure.php (line 34)

 

"Whitespace(s)" at the end.

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

Ah beware the infamous Whitespace. The invisible phantom lurking at the end of your .php files. The silent killer. Thanks for your help. I would have never guessed a space could screw things up like that. Now I know, and as G.I. Joe always said, "Knowing is half the battle."

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...