Jump to content

PHP Session and cookies array


jason360

Recommended Posts

Hey guys,

 

I have a login system that welcomes the user with their first name.  The system is working however it will not display the name when I log in with cookies, however the print_r array for cookies is showing that the 'first' name is working.

 

I am hacking away trial and error but not sure how to do this.  I tried various combos.  My cookie is $COOKIE['first']

 

My code is as follows:

<div class="tab">
	<ul class="login">
    	<li class="left"> </li>
        <li>Hello <?php echo $_SESSION['first'] ? $_SESSION['first']: 'Guest';?>!</li>
		<li class="sep">|</li>
		<li id="toggle">
			<a id="open" class="open" href="#"><?php echo $_SESSION['user_id']?'Open Panel':'Log In | Register';?></a>
			<a id="close" style="display: none;" class="close" href="#">Close Panel</a>			
		</li>
    	<li class="right"> </li>
	</ul> 
</div> <!-- / top -->

 

 

 

Thanks again!

 

JK

Link to comment
https://forums.phpfreaks.com/topic/265227-php-session-and-cookies-array/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.