View Single Post
Old 09-12-2008, 12:10 PM   PM User | #2
mic2100
Regular Coder

 
mic2100's Avatar
 
Join Date: Feb 2006
Location: Scunthorpe
Posts: 562
Thanks: 15
Thanked 28 Times in 27 Posts
mic2100 is on a distinguished road
there will be a few changes u need to do to achieve this

first you gotta take away all references to $_COOKIE and replace them with $_SESSION, then change...

PHP Code:
setcookie(ID_my_site$_POST['username'], $hour); 
setcookie(Key_my_site$_POST['pass'], $hour); 
to...
PHP Code:
$_SESSION['ID_my_site'] = $_POST['username']; 
$_SESSION['Key_my_site'] = $_POST['pass']; 
you must do this with any references to setcookie()

you will need to change all of these throughout the whole site for it to work correctly.
also i have found that session garbage collection or webservers can be done quite quickly some times, i wud recommend that you create a manual location to store sessions (outside of the root if possible), you do this like so...

PHP Code:
ini_set("session.save_path"$_SERVER['DOCUMENT_ROOT']."/sessions"); //sets the save path for the session variables 
ini_set("session.gc_maxlifetime""10000"); //sets the lifetime of the session before it removed.
session_start(); 
mic2100 is offline   Reply With Quote
Users who have thanked mic2100 for this post:
trixx (09-12-2008)