From b2de3c32ee635788f2f34c98d529fdc167ca6a51 Mon Sep 17 00:00:00 2001 From: rvelices Date: Fri, 1 Dec 2006 01:46:32 +0000 Subject: - sessions are always started (even for visitors) - thumbnail order saved in the session instead of cookie git-svn-id: http://piwigo.org/svn/trunk@1623 68402e56-0260-453c-a942-63ccdbb3a9ee --- index.php | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'index.php') diff --git a/index.php b/index.php index bd9755b85..e4d5232e6 100644 --- a/index.php +++ b/index.php @@ -40,12 +40,14 @@ check_status(ACCESS_GUEST); //---------------------------------------------- change of image display order if (isset($_GET['image_order'])) { - setcookie( - 'pwg_image_order', - $_GET['image_order'] > 0 ? $_GET['image_order'] : '', - 0, cookie_path() - ); - + if ( (int)$_GET['image_order'] > 0) + { + pwg_set_session_var('image_order', (int)$_GET['image_order']); + } + else + { + pwg_unset_session_var('image_order'); + } redirect( duplicate_index_url( array(), // nothing to redefine @@ -260,10 +262,7 @@ if (isset($page['cat_nb_images']) and $page['cat_nb_images'] > 0 // image order $template->assign_block_vars( 'preferred_image_order', array() ); - $order_idx = isset($_COOKIE['pwg_image_order']) - ? $_COOKIE['pwg_image_order'] - : 0 - ; + $order_idx = pwg_get_session_var( 'image_order', 0 ); $orders = get_category_preferred_image_orders(); for ($i = 0; $i < count($orders); $i++) -- cgit v1.2.3