Skip to content

Commit

Permalink
Use config_get_global for cookie_path
Browse files Browse the repository at this point in the history
Issue #23626
  • Loading branch information
atrol committed Nov 13, 2017
1 parent 16aa170 commit 5c86cd8
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions core/authentication_api.php
Expand Up @@ -849,7 +849,7 @@ function auth_clear_cookies() {
# clear cookie, if not logged in from script
if( $g_script_login_cookie == null ) {
$t_cookie_name = config_get( 'string_cookie' );
$t_cookie_path = config_get( 'cookie_path' );
$t_cookie_path = config_get_global( 'cookie_path' );

gpc_clear_cookie( $t_cookie_name, $t_cookie_path );
$t_cookies_cleared = true;
Expand Down Expand Up @@ -1162,7 +1162,7 @@ function auth_http_set_logout_pending( $p_pending ) {
if( $p_pending ) {
gpc_set_cookie( $t_cookie_name, '1', false );
} else {
$t_cookie_path = config_get( 'cookie_path' );
$t_cookie_path = config_get_global( 'cookie_path' );
gpc_clear_cookie( $t_cookie_name, $t_cookie_path );
}
}
Expand Down
4 changes: 2 additions & 2 deletions core/gpc_api.php
Expand Up @@ -377,7 +377,7 @@ function gpc_set_cookie( $p_name, $p_value, $p_expire = false, $p_path = null, $
}

if( null === $p_path ) {
$p_path = config_get( 'cookie_path' );
$p_path = config_get_global( 'cookie_path' );
}

if( null === $p_domain ) {
Expand All @@ -396,7 +396,7 @@ function gpc_set_cookie( $p_name, $p_value, $p_expire = false, $p_path = null, $
*/
function gpc_clear_cookie( $p_name, $p_path = null, $p_domain = null ) {
if( null === $p_path ) {
$p_path = config_get( 'cookie_path' );
$p_path = config_get_global( 'cookie_path' );
}
if( null === $p_domain ) {
$p_domain = config_get( 'cookie_domain' );
Expand Down
2 changes: 1 addition & 1 deletion core/session_api.php
Expand Up @@ -110,7 +110,7 @@ function __construct( $p_session_id = null ) {

# Handle session cookie and caching
session_cache_limiter( 'private_no_expire' );
session_set_cookie_params( 0, config_get( 'cookie_path' ), config_get( 'cookie_domain' ), $g_cookie_secure_flag_enabled, true );
session_set_cookie_params( 0, config_get_global( 'cookie_path' ), config_get( 'cookie_domain' ), $g_cookie_secure_flag_enabled, true );

# Handle existent session ID
if( !is_null( $p_session_id ) ) {
Expand Down
2 changes: 1 addition & 1 deletion search.php
Expand Up @@ -157,7 +157,7 @@
$t_row_id = filter_db_set_for_current_user( $t_project_id, false, '', $t_settings_string );

# set cookie values
gpc_set_cookie( config_get( 'view_all_cookie' ), $t_row_id, time()+config_get_global( 'cookie_time_length' ), config_get( 'cookie_path' ) );
gpc_set_cookie( config_get( 'view_all_cookie' ), $t_row_id, time()+config_get_global( 'cookie_time_length' ), config_get_global( 'cookie_path' ) );

# redirect to print_all or view_all page
if( $f_print ) {
Expand Down
2 changes: 1 addition & 1 deletion view_all_set.php
Expand Up @@ -225,7 +225,7 @@
$t_row_id = filter_db_set_for_current_user( $t_project_id, false, '', $t_settings_string );

# set cookie values
gpc_set_cookie( config_get( 'view_all_cookie' ), $t_row_id, time()+config_get_global( 'cookie_time_length' ), config_get( 'cookie_path' ) );
gpc_set_cookie( config_get( 'view_all_cookie' ), $t_row_id, time()+config_get_global( 'cookie_time_length' ), config_get_global( 'cookie_path' ) );
}

# redirect to print_all or view_all page
Expand Down

0 comments on commit 5c86cd8

Please sign in to comment.