Changeset 1421 in ExiteCMS for trunk/forum/post.php


Ignore:
Timestamp:
05/30/08 22:11:18 (4 years ago)
Author:
hverton
Message:

replaced cookie system for detecting duplicate posts by session variables, which is much more scalable

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/forum/post.php

    r1317 r1421  
    599599                        } 
    600600                        // check if this isn't a reload, back-post, or double submit 
    601                         if (isset($_COOKIE['post_'.$random_id])) { 
     601                        if (isset($_SESSION['posts'][$random_id])) { 
    602602                            $error = $locale['458']; 
    603603                        } else { 
    604604                            if (!$flood) { 
    605                                 setcookie("post_".$random_id, "posted", time()+60*60, "/", "", "0"); 
     605                                if (!isset($_SESSION['posts']) || !is_array($_SESSION['posts'])) $_SESSION['posts'] = array(); 
     606                                $_SESSION['posts'][$random_id] = time()+60*60*12; 
    606607                                $result = dbquery("UPDATE ".$db_prefix."forums SET forum_lastpost='".time()."', forum_lastuser='".$userdata['user_id']."' WHERE forum_id='$forum_id'"); 
    607608                                switch ($action) { 
Note: See TracChangeset for help on using the changeset viewer.