# Make changes to current user, without him being registered?

**URL:** <https://forum.bubble.io/t/make-changes-to-current-user-without-him-being-registered/66731>\
**Category:** Database\
**Created:** [September 12, 2019, 3:52pm UTC](https://forum.bubble.io/t/make-changes-to-current-user-without-him-being-registered/66731 "2019-09-12T15:52:12Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![hermes](https://avatars.discourse-cdn.com/v4/letter/h/f07891/32.png) [@hermes](https://forum.bubble.io/u/hermes)\
**Post date:** [September 12, 2019, 3:52pm UTC](https://forum.bubble.io/t/make-changes-to-current-user-without-him-being-registered/66731/1 "2019-09-12T15:52:12Z")

</div>

Is it possible to store data on a user who just arrived on the website?

**If yes, how?**

I have tried: `On page load` --\> `Make changes to current user` (I’m adding `this URL` to a custom field). But when I visit the user table, I don’t see `this URL` inside my custom field.

---

<div class="post-metadata">

**Author:** ![reger-alexander](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/reger-alexander/32/22827_2.png) [@reger-alexander](https://forum.bubble.io/u/reger-alexander)\
**Post date:** [September 12, 2019, 4:03pm UTC](https://forum.bubble.io/t/make-changes-to-current-user-without-him-being-registered/66731/2 "2019-09-12T16:03:36Z")

</div>

Unregistered users are saved as cookies. The changed data is visible as soon as the user registers and a user data entry is created in the DB, which automatically gets the saved changes from the cookie.

---

<div class="post-metadata">

**Author:** ![hermes](https://avatars.discourse-cdn.com/v4/letter/h/f07891/32.png) [@hermes](https://forum.bubble.io/u/hermes)\
**Post date:** [September 12, 2019, 4:08pm UTC](https://forum.bubble.io/t/make-changes-to-current-user-without-him-being-registered/66731/3 "2019-09-12T16:08:34Z")

</div>

@reger-alexander thanks for this information!

Is there a way in Bubble to “save” information on a logged out user, even if he closes his browser?

> […] If the user is logged out, you can still modify the user object, but once the user closes their browser, you will not be able to access the user’s information.

Or I must use custom javascript to create my own cookie for this purpose?

---

<div class="post-metadata">

**Author:** ![nocodeventure](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/nocodeventure/32/247164_2.png) [@nocodeventure](https://forum.bubble.io/u/nocodeventure)\
**Post date:** [September 12, 2019, 4:18pm UTC](https://forum.bubble.io/t/make-changes-to-current-user-without-him-being-registered/66731/4 "2019-09-12T16:18:44Z")

</div>

I guess you could track a user’s IP, There is no solid way to track logged out users as they are protected by privacy laws.

You can store cookies.

---

<div class="post-metadata">

**Author:** ![hermes](https://avatars.discourse-cdn.com/v4/letter/h/f07891/32.png) [@hermes](https://forum.bubble.io/u/hermes)\
**Post date:** [September 12, 2019, 4:27pm UTC](https://forum.bubble.io/t/make-changes-to-current-user-without-him-being-registered/66731/5 "2019-09-12T16:27:02Z")

</div>

Legally, I can store cookie as long as the user accepts it.

The question is **can I do it with Bubble** , or I must do it with Javascript?

```
    // Helpers 
    function setCookie(cname, cvalue, exdays) {
		var date = new Date();
		date.setTime(date.getTime() + (exdays*24*60*60*1000));
		var expires = "expires="+ date.toUTCString();
		document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/";
	}

	function getCookie(cname) {
		var name = cname + "=";
		var decodedCookie = decodeURIComponent(document.cookie);
		var ca = decodedCookie.split(';');
		for(var i = 0; i <ca.length; i++) {
			var c = ca[i];
			while (c.charAt(0) == ' ') {
			  c = c.substring(1);
			}
			if (c.indexOf(name) == 0) {
			  return c.substring(name.length, c.length);
			}
		}
		return "";
	}
```

---

<div class="post-metadata">

**Author:** ![reger-alexander](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/reger-alexander/32/22827_2.png) [@reger-alexander](https://forum.bubble.io/u/reger-alexander)\
**Post date:** [September 12, 2019, 4:30pm UTC](https://forum.bubble.io/t/make-changes-to-current-user-without-him-being-registered/66731/6 "2019-09-12T16:30:01Z")

</div>

You can use this plugin

> **[Browser Session or Local Storage Plugin for Bubble](https://bubble.io/plugin/browser-session-or-local-storage-1514075906887x122169717659009020)**
>
> Browser Session or Local Storage Plugin page on Bubble. Add Browser Session or Local Storage in one click to your app. Bubble lets you build web apps without any code.

---

<div class="post-metadata">

**Author:** ![hermes](https://avatars.discourse-cdn.com/v4/letter/h/f07891/32.png) [@hermes](https://forum.bubble.io/u/hermes)\
**Post date:** [September 12, 2019, 4:35pm UTC](https://forum.bubble.io/t/make-changes-to-current-user-without-him-being-registered/66731/7 "2019-09-12T16:35:04Z")

</div>

Thanks @reger-alexander, I assume that It’s not possible with bubble and that I must use JS or a Plugin, I’ll use Javascript here (it was a matter of 2 minutes development.) But I’m surprised that bubble won’t let you store custom cookies.

---

<div class="post-metadata">

**Author:** ![nocodeventure](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/nocodeventure/32/247164_2.png) [@nocodeventure](https://forum.bubble.io/u/nocodeventure)\
**Post date:** [September 12, 2019, 4:44pm UTC](https://forum.bubble.io/t/make-changes-to-current-user-without-him-being-registered/66731/8 "2019-09-12T16:44:25Z")

</div>

You can use the JavaScript Workflow plugin for this. I think bubble already tracks people. So its possible to store current user even when they are logged out.

---

<div class="post-metadata">

**Author:** ![hermes](https://avatars.discourse-cdn.com/v4/letter/h/f07891/32.png) [@hermes](https://forum.bubble.io/u/hermes)\
**Post date:** [September 13, 2019, 11:36am UTC](https://forum.bubble.io/t/make-changes-to-current-user-without-him-being-registered/66731/9 "2019-09-13T11:36:57Z")

</div>

@nocodeventure Thanks, I bought it.

Technically how is that plugin able to execute server-side Javascript ?  
Even if it requires lots of code, how can I execute server-side JS without a plugin?

---

<div class="post-metadata">

**Author:** ![hermes](https://avatars.discourse-cdn.com/v4/letter/h/f07891/32.png) [@hermes](https://forum.bubble.io/u/hermes)\
**Post date:** [September 13, 2019, 9:21pm UTC](https://forum.bubble.io/t/make-changes-to-current-user-without-him-being-registered/66731/10 "2019-09-13T21:21:22Z")

</div>

I couldn’t find this information inside the reference: [https://bubble.io/reference](https://bubble.io/reference). But for anyone searching, I found it on the forum, **it’s possible to execute some server-side Javascript** by creating a plugin.

Create a new plugin: [https://bubble.io/my\_plugins](https://bubble.io/my_plugins), then click on:  
Actions --\> Add a new action --\> General properties --\> Action type [Server side]

_tags: bubble nodejs node server-side javascript js_
