chris_s_22 Posted November 22, 2009 Share Posted November 22, 2009 any ideas how i update my session? when someone logs into site it creates a session // Now encrypt the data to be stored in the session $encrypted_id = md5($user['id']); $encrypted_name = md5($user['username']); // Store the data in the session $_SESSION['id'] = $id; $_SESSION['username'] = $username; $_SESSION['encrypted_id'] = $encrypted_id; $_SESSION['encrypted_name'] = $encrypted_name; this code is what im using $query = "UPDATE members SET username = '$newusername' WHERE username = '$username'"; $result= mysql_query ($query) or die ('Could not create user.'); // if suceesfully inserted data into database, if($result) { $_SESSION['username'] = $newusername; header('Location: home.php'); } as you can see this updates the username then redirects to home.php this page checks if the user is_authed so i need to update session data Link to comment https://forums.phpfreaks.com/topic/182510-updating-session/ Share on other sites More sharing options...
Cardale Posted November 22, 2009 Share Posted November 22, 2009 It isn't clear to me what your trying to do. Link to comment https://forums.phpfreaks.com/topic/182510-updating-session/#findComment-963310 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.