WordPress.org

Forums

WP Session Manager
array storing (1 post)

  1. sarankumar
    Member
    Posted 1 year ago #

    iam tring to store an array using wp-sessions.my code shown below.

    if(isset($_POST['id']))
    		{
    		$wp_session = WP_Session::get_instance();
    		if(isset($wp_session['ym_cart']))
    		  {
    		$wp_session['ym_cart'][]=$_POST['id'];
    		 }
                      else
    		{
    		$wp_session['ym_cart']= array();
    		$wp_session['ym_cart'][]=$_POST['id'];
    		}
    
    		print_r($wp_session['ym_cart']);
    
    	    }

    'ID' is coming from an ajax form submission.Error is array storing only one value.How can i push values to these array ?

    https://wordpress.org/plugins/wp-session-manager/

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WP Session Manager
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic