php - how to store gmail profile picture in session? -


i had perform login via gmail using oauth. want display user's name , profile photo in header. once had achieve passing these values controller view in views want name , photo had try store 2 values in session got success in name not in image. so, how achieve this?? or there way this??

controller :

$email = filter_var($user['email'], filter_sanitize_email); $img = filter_var($user['picture'], filter_validate_url); $name = $user['name']; $data=array('name'=>$name,'image'=>$img,'email'=>$email); $this->load->library('session'); $this->session->set_userdata($data); 

view :

<?php echo $this->session->userdata('name'); ?> <img class="login" src="<?php echo $this->session->userdata('image'); ?>" alt=" " style="border-radius: 50% 50% 50% 50%; height: 60px; width: 60px"/> 

you don't have store whole image in session have store imageurl in session , can use session value in other view hope you.


Comments

Popular posts from this blog

Payment information shows nothing in one page checkout page magento -

tcpdump - How to check if server received packet (acknowledged) -