PDA

View Full Version : سوال: sessions



aks2download
چهارشنبه 06 آبان 1388, 18:21 عصر
سلام
من وقتی از طریق فرم login وارد سایتم میشم یک session ایجاد میکنم
با دستور : $_SESSION['student']="$username";
من میخوام بعد یه مدت مثلا 5 دقیقه این session را نابود کنم.
session_unset($_SESSION['student']=="$username");
کسی میتونه با یه کد منو راهنمایی کنه؟؟؟

miladanimator
چهارشنبه 06 آبان 1388, 21:49 عصر
<?php

/* set the cache limiter to 'private' */

session_cache_limiter('private');
$cache_limiter = session_cache_limiter();

/* set the cache expire to 30 minutes */
session_cache_expire(30);
$cache_expire = session_cache_expire();

/* start the session */

session_start();

echo "The cache limiter is now set to $cache_limiter<br />";
echo "The cached session pages expire after $cache_expire minutes";
?>