Answers.Body: <p>Aah, </p>
  
  <p>Indeed, the cookie should apply only to the petition (ie contain the petition id).</p>
  
  <p>It's a bug and shouldn't be difficult to fix. Do you or someone in your team have the skills to fix it? PR welcome ;)</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-11-07T20:14:17.297Z
Answers.Text: Do a search on setcookie in the source code. In is used only once in the CiviCRM code base. See https://github.com/civicrm/civicrm-core/search?utf8=%E2%9C%93&q=setcookie .
Answers.UserDisplayName: Kainuk - CiviCooP
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-10-14T15:33:34.233Z
Answers.Text: Hi, though I have some knowledge in customizing and bug fixing, I have no clue where to change that.
  
  Any hint?
Answers.UserDisplayName: Detlev Sieber
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-10-14T09:44:22.363Z
Answers.LastActivityDate: 2015-10-14T09:44:22.363Z
Answers.UserDisplayName: Xavier
Body: <p>I set up an online petition using CiviCRM 4.6 on Drupal 7.</p>
  
  <p>During the process, the status of the petition is stored in two cookies ("signed" and "confirmed"), which controls to process flow. </p>
  
  <p>Both cookies are valid for 24 hours.</p>
  
  <p>However, the drawback is, that it is not possible to enter another petition directly after the first one from the same pc - since the cookies remain valid fr 24 hours.</p>
  
  <p>Is there a possibility to to limit the cookie lifetime to the session? So that the cookies are deleted, when the browser window is closed?</p>
  
  <p>Thank in advance!</p>
  
Tags: <drupal><civicampaign>
Title: Set cookies for petitions (and probably other online forms) as session cookies that will expire after signing
ThreadText: # Set cookies for petitions (and probably other online forms) as session cookies that will expire after signing
  
  (Asked by: username_0 on 2015-10-14)
  
  I set up an online petition using CiviCRM 4.6 on Drupal 7.
  
  During the process, the status of the petition is stored in two cookies ("signed" and "confirmed"), which controls to process flow.
  
  Both cookies are valid for 24 hours.
  
  However, the drawback is, that it is not possible to enter another petition directly after the first one from the same pc - since the cookies remain valid fr 24 hours.
  
  Is there a possibility to to limit the cookie lifetime to the session? So that the cookies are deleted, when the browser window is closed?
  
  Thank in advance!
  
  **Tags:** drupal, civicampaign
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2015-10-14. Score: 1
  
  Aah,
  
  Indeed, the cookie should apply only to the petition (ie contain the petition id).
  
  It's a bug and shouldn't be difficult to fix. Do you or someone in your team have the skills to fix it? PR welcome ;)
  
  > **Comments:**
  > **username_0**: Hi, though I have some knowledge in customizing and bug fixing, I have no clue where to change that.  Any hint?  
  > **username_2**: Do a search on setcookie in the source code. In is used only once in the CiviCRM code base. See https://github.com/civicrm/civicrm-core/search?utf8=%E2%9C%93&q=setcookie .  
  
  ---
  
  