Index: src/Form/PollSettingsForm.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/Form/PollSettingsForm.php	(revision 07bf287e93d19f77f24b8a20e52316b8d0d3c981)
+++ src/Form/PollSettingsForm.php	(revision )
@@ -21,19 +21,36 @@
    * {@inheritdoc}
    */
   protected function getEditableConfigNames() {
-    return [];
+    return ['poll.settings'];
   }
 
   /**
    * {@inheritdoc}
    */
   public function buildForm(array $form, FormStateInterface $form_state) {
-    // This exists to make the field UI pages visible and must not be removed.
-    $form['account'] = array(
-      '#markup' => '<p>' . t('There are no settings yet.') . '</p>',
-    );
+    $config = $this->config('poll.settings');
 
-    return $form;
+    $form['voting_restrictions'] = [
+      '#type' => 'select',
+      '#title' => t('Anonymous user voting restrictions'),
+      '#options' => [
+        'ip' => t('One vote per IP'),
+        'session' => t('One vote per session'),
+      ],
+      '#default_value' => $config->get('voting_restrictions')?:'ip',
+    ];
+
+    return parent::buildForm($form, $form_state);
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function submitForm(array &$form, FormStateInterface $form_state) {
+    $config = $this->config('poll.settings');
+    $config->set('voting_restrictions', $form_state->getValue('voting_restrictions'));
+    $config->save();
+    parent::submitForm($form, $form_state);
   }
 }
 
Index: src/PollVoteStorage.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/PollVoteStorage.php	(revision 07bf287e93d19f77f24b8a20e52316b8d0d3c981)
+++ src/PollVoteStorage.php	(revision )
@@ -63,6 +63,8 @@
    * {@inheritdoc}
    */
   public function cancelVote(PollInterface $poll, AccountInterface $account = NULL) {
+    $_SESSION['poll_vote'][$poll->id()] = FALSE;
+
     if ($account->id()) {
       $this->connection->delete('poll_vote')
         ->condition('pid', $poll->id())
@@ -121,6 +123,7 @@
    */
   public function getUserVote(PollInterface $poll) {
     $uid = \Drupal::currentUser()->id();
+
     if ($uid || $poll->getAnonymousVoteAllow()) {
       if ($uid) {
         $query = $this->connection->query("SELECT * FROM {poll_vote} WHERE pid = :pid AND uid = :uid", array(
@@ -129,13 +132,22 @@
         ));
       }
       else {
-        $query = $this->connection->query("SELECT * FROM {poll_vote} WHERE pid = :pid AND hostname = :hostname AND uid = 0", array(
-          ':pid' => $poll->id(),
-          ':hostname' => \Drupal::request()->getClientIp()
-        ));
+        $voting_restrictions = \Drupal::config('poll.settings')->get('voting_restrictions')?:'ip';
+        switch ($voting_restrictions) {
+          case 'session':
+            return !empty($_SESSION['poll_vote'][$poll->id()]) ? $_SESSION['poll_vote'][$poll->id()] : FALSE;
+            break;
+          default:
+            $query = $this->connection->query("SELECT * FROM {poll_vote} WHERE pid = :pid AND hostname = :hostname AND uid = 0", array(
+              ':pid' => $poll->id(),
+              ':hostname' => \Drupal::request()->getClientIp()
+            ));
+            break;
+        }
       }
       return $query->fetchAssoc();
     }
+
     return FALSE;
   }
 
Index: src/Form/PollViewForm.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/Form/PollViewForm.php	(revision 07bf287e93d19f77f24b8a20e52316b8d0d3c981)
+++ src/Form/PollViewForm.php	(revision )
@@ -61,7 +61,10 @@
           // If this happened, then the form submission was likely a cached page.
           // Force a session for this user so he can see the results.
           drupal_set_message($this->t('Your vote for this poll has already been submitted.'), 'error');
-          $_SESSION['poll_vote'][$this->poll->id()] = FALSE;
+
+          if (\Drupal::config('poll.settings')->get('voting_restrictions') != 'session') {
+            $_SESSION['poll_vote'][$this->poll->id()] = FALSE;
+          }
         }
       }
 
Index: poll.install
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- poll.install	(revision 07bf287e93d19f77f24b8a20e52316b8d0d3c981)
+++ poll.install	(revision )
@@ -14,6 +14,12 @@
   $schema['poll_vote'] = array(
     'description' => 'Stores per-{users} votes for each {poll}.',
     'fields' => array(
+      'id' => array(
+        'type' => 'serial',
+        'unsigned' => TRUE,
+        'not null' => TRUE,
+        'description' => "The {users}'s vote id.",
+      ),
       'chid' => array(
         'type' => 'int',
         'unsigned' => TRUE,
@@ -47,7 +53,7 @@
         'description' => 'The timestamp of the vote creation.',
       ),
     ),
-    'primary key' => array('pid', 'uid', 'hostname'),
+    'primary key' => array('id'),
     'foreign keys' => array(
       'poll_entity' => array(
         'table' => 'poll',
@@ -59,9 +65,7 @@
       ),
     ),
     'indexes' => array(
-      'chid' => array('chid'),
-      'hostname' => array('hostname'),
-      'uid' => array('uid'),
+      'id' => array('id'),
     ),
   );
 
@@ -125,3 +129,23 @@
   $field_schema['poll__choice']['indexes']['choice_target_id'] = ['choice_target_id'];
   \Drupal::keyValue('entity.storage_schema.sql')->set('poll.field_schema_data.choice', $field_schema);
 }
+
+/**
+ * Add id - unique key for votes.
+ */
+function poll_update_8002() {
+  $schema = \Drupal::database()->schema();
+  $schema->dropIndex('poll_vote', 'chid');
+  $schema->dropIndex('poll_vote', 'hostname');
+  $schema->dropIndex('poll_vote', 'uid');
+  $schema->dropPrimaryKey('poll_vote');
+  $target_id_schema = [
+    'type' => 'serial',
+    'unsigned' => TRUE,
+    'not null' => TRUE,
+    'description' => "The {users}'s vote id.",
+  ];
+
+  $schema->addField('poll_vote', 'id', $target_id_schema, ['primary key' => ['id']]);
+  $schema->addIndex('poll_vote', 'id', ['id'], ['fields' => ['id' => $target_id_schema]]);
+}
