aboutsummaryrefslogtreecommitdiffstats
path: root/index.php
diff options
context:
space:
mode:
Diffstat (limited to 'index.php')
-rw-r--r--index.php19
1 files changed, 9 insertions, 10 deletions
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++)