jason360 Posted July 5, 2012 Share Posted July 5, 2012 Hey guys, Any idea how to add a cookie to this string? $_COOKIE['first'] Thanks <?php echo $_SESSION['first'] ? $_SESSION['first']: 'Guest';?> Quote Link to comment https://forums.phpfreaks.com/topic/265251-cookies-in-php-script/ Share on other sites More sharing options...
jason360 Posted July 5, 2012 Author Share Posted July 5, 2012 This worked: if(isset($_COOKIE['user_id'])) { $_SESSION['user_id'] = $_COOKIE['user_id']; } Quote Link to comment https://forums.phpfreaks.com/topic/265251-cookies-in-php-script/#findComment-1359446 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.