Title: Getting session variable in CF7
Last modified: June 8, 2017

---

# Getting session variable in CF7

 *  Resolved [thomasttte](https://wordpress.org/support/users/thomasttte/)
 * (@thomasttte)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/getting-session-variable-in-cf7/)
 * Hi there,
 * I have some user information stored in session keys on my WordPress site.
    This
   info is then included when using Contact Form 7, where I’ve used a modified version
   of this plugin: [https://wordpress.org/plugins/contact-form-7-get-and-show-parameter-from-url/](https://wordpress.org/plugins/contact-form-7-get-and-show-parameter-from-url/)
 * However, after the latest update to Contact form 7, the above plugin no longer
   works .
 * Any ideas on a simple solution to include my session variables in Contact form
   7?
    I’m not a php programmer, so the simpler the better, and preferably a plugin.
 * Is it possible to get the sessions variable with the get:default, as described
   here?
    [https://contactform7.com/getting-default-values-from-the-context/](https://contactform7.com/getting-default-values-from-the-context/)
 * Thanks for your help.
 * Best regards,
    Thomas

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [Takayuki Miyoshi](https://wordpress.org/support/users/takayukister/)
 * (@takayukister)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/getting-session-variable-in-cf7/#post-9209485)
 * [https://wordpress.org/support/plugin/contact-form-7-get-and-show-parameter-from-url](https://wordpress.org/support/plugin/contact-form-7-get-and-show-parameter-from-url)
 * Here is the support forum for the plugin.
 *  Thread Starter [thomasttte](https://wordpress.org/support/users/thomasttte/)
 * (@thomasttte)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/getting-session-variable-in-cf7/#post-9212612)
 * Thanks, but I was wondering if there’s a way to get it directly from CF7 as with
   parameters from URL: [https://contactform7.com/getting-default-values-from-the-context/](https://contactform7.com/getting-default-values-from-the-context/)
 * Just via a session variable. Is anything build in to CF7 to handle this?
 * Thanks.
 * Best regards,
    Thomas
 *  [cravaus](https://wordpress.org/support/users/cravaus/)
 * (@cravaus)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/getting-session-variable-in-cf7/#post-9215770)
 * I am not sure what exactly you are trying to pull out but for url’s I use this
   short code:
 *     ```
       /*
        * SHORTCODE FOR HOME URL
        */ 
       function myUrl($atts, $content = null) {
       	extract(shortcode_atts(array(
       		"href" => home_url()
       	), $atts));
       	return $href;
       }
       add_shortcode("url", "myUrl");
       ```
   
 *  Thread Starter [thomasttte](https://wordpress.org/support/users/thomasttte/)
 * (@thomasttte)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/getting-session-variable-in-cf7/#post-9218824)
 * Thanks, however, I have a session key/variable that I’d like to pull into the
   contact form, so that it’s included (the submitter should not see it) on the 
   email that I receive.
 * Thanks.
 * Best regards,
    Thomas

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Getting session variable in CF7’ is closed to new replies.

 * ![](https://ps.w.org/contact-form-7/assets/icon.svg?rev=2339255)
 * [Contact Form 7](https://wordpress.org/plugins/contact-form-7/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/contact-form-7/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/contact-form-7/)
 * [Active Topics](https://wordpress.org/support/plugin/contact-form-7/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/contact-form-7/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/contact-form-7/reviews/)

## Tags

 * [variable](https://wordpress.org/support/topic-tag/variable/)

 * 4 replies
 * 3 participants
 * Last reply from: [thomasttte](https://wordpress.org/support/users/thomasttte/)
 * Last activity: [8 years, 11 months ago](https://wordpress.org/support/topic/getting-session-variable-in-cf7/#post-9218824)
 * Status: resolved