We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Safecracker Set Session Variable Upon Submit

Development and Programming

ajtroxell's avatar
ajtroxell
1 posts
13 years ago
ajtroxell's avatar ajtroxell

I am using SafeCracker to allow guests to post an entry, and upon submitting said entry are forwarded to another page allowing them to watch a video. I have the Session Variables Plugin, but need to somehow set a Session Variable upon the SafeCracker form being submitted. This would then expire after a specific amount of time so the user cannot come back and view the video again without filling out the form once more.

Is there a way to set this session variable (unique to each submission) when the form is submitted?

       
ahmad saad's avatar
ahmad saad
364 posts
13 years ago
ahmad saad's avatar ahmad saad

I think u can use {current_time} to generate a unique value per submission

       
ajtroxell's avatar
ajtroxell
1 posts
13 years ago
ajtroxell's avatar ajtroxell

I just dont know how to go about passing this value to the page that safecracker loads after it is submitted.

       
jphansen80's avatar
jphansen80
20 posts
12 years ago
jphansen80's avatar jphansen80

I had a similar question, basically can I get the $_POST[‘variable’] or $_REQUEST[‘variable’] from a Safecracker submission. I haven’t found a way directly, but an unelegant way would be to use Safecracker to add this entry to some channel, then retrieve this entry’s data and assign it to your $_SESSION variable. You can later on delete the channel entry. So basically it would work similar to how a PHP session variable works, that is it creates a file and stores the value, then deletes the file, except you’d be doing this in a channel entry. Depending on your traffic your incremental entry id could get rather high though.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.