# How to recognise client, or save device in cookie?

**URL:** https://community.thunkable.com/t/how-to-recognise-client-or-save-device-in-cookie/1435150
**Category:** Questions about Thunkable X
**Tags:** beginner
**Created:** [August 6, 2021, 9:07pm UTC](https://community.thunkable.com/t/how-to-recognise-client-or-save-device-in-cookie/1435150 "2021-08-06T21:07:54Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![nlklta236](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/nlklta236/32/112754_2.png) [@nlklta236](https://community.thunkable.com/u/nlklta236)
#### Post date: [August 6, 2021, 9:07pm UTC](https://community.thunkable.com/t/how-to-recognise-client-or-save-device-in-cookie/1435150/1 "2021-08-06T21:07:54Z")

</div>

Hello everyone!  
I have made an app for my pet hotel. And everything is working good, but I am facing with one problem. We have severals ip cams in our hotel, and we give access to our clients, while their pets are staying in our hotel, approximately about 1-2 weeks. So I have made AirTable database with following information: Name of a cam, Image of a cam, Cam Link and a password. So when client want to see the cam, he choose a cam for data view grid

 ![Снимок экрана 2021-08-06 в 21.58.23](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/c/1/c1a7eea39ef35f7b9cce546163796cfee7954385.png)  
, then he enters the password ![Password Screen](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/5/5/558ad5f4f02cd02ff7b4cff3f44e6072da4a4349.png)  
and finally gets access to cameras ![Cam Screen](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/8/2/82a7ab68a9d3dcda93647ccf9b343794a63b2307.png)

But, if he want to see another cam, he need to enter the password again.

How I can give him access for example for 15 minutes. And after the time is up, he will have to enter the password again?

* * *

Всем привет!  
Вдруг мне попадаться русско говорящие пользователи)))

Опишу проблему и на русском, я сделал приложение для своего отеля для собак. Одна из функций нашего отеля, это предоставление доступа к камерам отеля, на время проживания их питомца. Примерно 1 - 2 недели. Так вот, я сделал базу данных на AirTable, в которой сохранил: имя камеры, фотография камеры, ссылка на камеру и пароль от камер. В самом приложении я сделал пункт доступ к камерам, пользователь выбирает камеру которую он хочет посмотреть, потом вводит пароль от неё и попадёт на страницу с камерой. Так вот вопрос следующий, как определить пользователя, который только что ввел успешний пароль от камеры, чтобы дать ему доступ к камерам на ближайшие 15 минут к примеру, а потом опять запросить у него пароль. Есть идеи?

---

<div class="post-metadata">

### Author: ![jonathonschnoor6x4b5](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jonathonschnoor6x4b5/32/112262_2.png) [@jonathonschnoor6x4b5](https://community.thunkable.com/u/jonathonschnoor6x4b5)
#### Post date: [August 6, 2021, 9:18pm UTC](https://community.thunkable.com/t/how-to-recognise-client-or-save-device-in-cookie/1435150/2 "2021-08-06T21:18:38Z")

</div>

It’s really simple. You can:

Wait 900 seconds (15 minutes) before navigating to the login screen.

or

Set a stored var to “Seconds since 1970” block. Use the “Seconds since 1970” block and do a little math.  
`if [(Seconds since 1970) - (TimeVar)] ≤ 900 Navigate to (LoginScreen)`

---

<div class="post-metadata">

### Author: ![nlklta236](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/nlklta236/32/112754_2.png) [@nlklta236](https://community.thunkable.com/u/nlklta236)
#### Post date: [August 6, 2021, 9:46pm UTC](https://community.thunkable.com/t/how-to-recognise-client-or-save-device-in-cookie/1435150/3 "2021-08-06T21:46:36Z")

</div>

Jonathon, thanks. But you didn’t understand me. So I will show you. Sorry, for my bad English((

> **[Запись экрана 2021-08-07 в 00.41.45.mov (video)](https://drive.google.com/file/d/1WD19MY51ptRnsLiAdVfqlE_f7TnIs_uY/view?usp=sharing)**
>
> Google Drive file.

---

<div class="post-metadata">

### Author: ![jonathonschnoor6x4b5](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jonathonschnoor6x4b5/32/112262_2.png) [@jonathonschnoor6x4b5](https://community.thunkable.com/u/jonathonschnoor6x4b5)
#### Post date: [August 6, 2021, 9:58pm UTC](https://community.thunkable.com/t/how-to-recognise-client-or-save-device-in-cookie/1435150/4 "2021-08-06T21:58:28Z")

</div>

I see what you mean.

What you need is a variable, named “AskForPassword?” or something and intialize it to `true`

Then when the user enters the password, it will set AskForPassword to `false` and wait 900 seconds.  
When the 900 seconds are up, it will set AskForPassword to `true`

The last thing you need is when the screen loads up, it checks if AskForPassword is true or false.  
If it’s true, it will ask for the Password.  
If it’s false, it won’t show it.

(Also, your English is fine! 🙂)

---

<div class="post-metadata">

### Author: ![nlklta236](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/nlklta236/32/112754_2.png) [@nlklta236](https://community.thunkable.com/u/nlklta236)
#### Post date: [August 6, 2021, 10:25pm UTC](https://community.thunkable.com/t/how-to-recognise-client-or-save-device-in-cookie/1435150/5 "2021-08-06T22:25:34Z")

</div>

I see your logic, thanks! And for my English thanks too !!

So I made the first step:

> [@jonathonschnoor6x4b5](#):
>
> Then when the user enters the password, it will set AskForPassword to `false` and wait 900 seconds.  
> When the 900 seconds are up, it will set AskForPassword to `true`

 ![Снимок экрана 2021-08-07 в 01.14.55](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/9/5/95a0f0055eda46dec52c0213e54bfba6509b6d81.png)

But I can’t understand how to do the next step… I made somethings like this, but I understand that it is wrong((

> [@jonathonschnoor6x4b5](#):
>
> The last thing you need is when the screen loads up, it checks if AskForPassword is true or false.  
> If it’s true, it will ask for the Password.  
> If it’s false, it won’t show it.

 ![Снимок экрана 2021-08-07 в 01.23.13](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/7/0761a28869ee9e3b03c78a781ac28946f445a46b.png)

---

<div class="post-metadata">

### Author: ![jonathonschnoor6x4b5](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jonathonschnoor6x4b5/32/112262_2.png) [@jonathonschnoor6x4b5](https://community.thunkable.com/u/jonathonschnoor6x4b5)
#### Post date: [August 6, 2021, 10:59pm UTC](https://community.thunkable.com/t/how-to-recognise-client-or-save-device-in-cookie/1435150/6 "2021-08-06T22:59:44Z")

</div>

Try

```auto
if AskForPassword = True
do navigate to Password_Screen
else navigate to Screen Cam

```

Or for the last line of code you could use

```auto
else if AskForPassword = False
do navigate to Screen Cam

```

---

<div class="post-metadata">

### Author: ![nlklta236](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/nlklta236/32/112754_2.png) [@nlklta236](https://community.thunkable.com/u/nlklta236)
#### Post date: [August 7, 2021, 8:52am UTC](https://community.thunkable.com/t/how-to-recognise-client-or-save-device-in-cookie/1435150/7 "2021-08-07T08:52:30Z")

</div>

Jonathon, thanks again!!

But o have tried several times, and it work, but only for 1 time((

And after you have entered the correct password at least once, it will always be started up without a password.

 ![Снимок экрана 2021-08-07 в 11.40.30](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/4/c/4cd8a69e044ec574941dbcd4a5612b61dbde08eb.png)  
 ![Снимок экрана 2021-08-07 в 11.49.22](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/9/5/955e0ca726f149dced7a92f72e3c7b32443bc7de.png)

---

<div class="post-metadata">

### Author: ![jonathonschnoor6x4b5](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jonathonschnoor6x4b5/32/112262_2.png) [@jonathonschnoor6x4b5](https://community.thunkable.com/u/jonathonschnoor6x4b5)
#### Post date: [August 7, 2021, 4:49pm UTC](https://community.thunkable.com/t/how-to-recognise-client-or-save-device-in-cookie/1435150/8 "2021-08-07T16:49:03Z")

</div>

Copy when LogIn Click.  
Remove the else statement and the navigate to Screen Cam.  
And remove the part where it sets the AskForPassword from the original code.

---

<div class="post-metadata">

### Author: ![nlklta236](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/nlklta236/32/112754_2.png) [@nlklta236](https://community.thunkable.com/u/nlklta236)
#### Post date: [August 7, 2021, 8:06pm UTC](https://community.thunkable.com/t/how-to-recognise-client-or-save-device-in-cookie/1435150/9 "2021-08-07T20:06:52Z")

</div>

Thanks! I made little bit different, but it works!

---

<div class="post-metadata">

### Author: ![ioannis](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ioannis/32/146956_2.png) [@ioannis](https://community.thunkable.com/u/ioannis)
#### Post date: [November 8, 2024, 1:17pm UTC](https://community.thunkable.com/t/how-to-recognise-client-or-save-device-in-cookie/1435150/10 "2024-11-08T13:17:35Z")

</div>


