I assumne that $clicks is an array with up to ten visited articles. The id is used as key and the timestamp as value. $id is the id of the new article.

$clicks = $this-&gt;session-&gt;userdata('article_clicks');

//default value
$clicks = ($clicks)? $clicks : array();

//could be loaded from config
$maxItemCount = 10;
$timwToLive= 600;

//helpers
$time = time();
$deadline = $time - $timeToLive;

//add if not in list
if(! isset($clicks[$id]) ){
  $clicks[$id] = $time;
}
//remove old values
$clicks = array_filter($clicks, function($value){ $value &gt;= $deadline;});

//sort newest to oldest
arsort($clicks);

//limit items, oldest will be removed first because we sorted the array
$clicks = array_slice($clicks, 0, $maxItemCount);

//save to session
$this-&gt;session-&gt;&gt;set_userdata('article_clicks',$clicks)


Usage:

//print how mch time has passed since the last visit
if(isset($clicks[$id]){
  echo "visited ".($time-$clicks[$id]). "seconds ago." ;
} else {
  echo "first visit";
}


EDIT: you have to use arsort not rsort or the keys will be lost, sorry

How to remember 10 last read articles with timestamp in session for a user in Codeigniter?
Define 

$$ h_n (x) = x^{1 + {1 \over 2n - 1}}$$ for $x \in [-1,1]$. 

Why is $\lim_{n \to \infty} h_n(x) = |x|$? I know that for $C &gt; 0$ it holds that 
$$ \lim_{n \to \infty} C^{1\over n} = 1$$

but I don't know why the other limit should hold. Especially not 
$$ \lim_{n \to \infty} C^{1\over n} = -1$$
if $C &lt; 0$.
