What alternatives for using the agent link?

First, thanks to all of you who help with my project. I was able to complete my demo.
I would like to have my boss look at it before I bring it for the show to see if there is anything that he would like changed.
I do not want to send him my agent link just yet, primary because if I am developing with it, and he is checking playing with it at the same time I will think things are buggy because we are both controlling the same thing.

So Is there another way around sending him my agent link?

Are you using the agent as an HTML website? Or are you just sending the agent values using the agent URL?

Can you briefly describe what you are demonstrating?

The answer may or may not be to use a remote website on the internet (with PHP and Javascripting). The URL will be that site, not the agent’s. PHP can POST anything to the agent without showing the agent URL.

Are you using the agent as an HTML website? Or are you just sending the agent values using the agent URL?

Both, I have 4 pages. The first page is the home page which is the agent url.
On the main page there are 3 tabs, each with their own webpage.
The first tab has 3 on/off controls which control 3 strobe lights.
the second tab is for displaying temperature, which I have mounted a IR temp senor to the board. There is also another control for you to enter in a temperature to trigger an alarm when the onboard temp gets to high.
the 3’rd page shows the current weather conditions.

The agent is hosting the website, so there’s not much you can do. The agent URL is the URL.

How about creating a password …
Have a textbox on the home page where you enter, 2015 … the same way you are entering a temperature setpoint.
If the agent sees that value, it will allow the other tabs to appear.

I guess it would be javascripting? It would be nice if the imp utilized cookies or sessions.

I did think of adding a password, but thought if there was a simpler alternate I would go that route before adding more code. I think it would be nice if the IDE had a feature to get/assign different ID’s to the device, so in situations like this we have an out.

The only way I know is to embed the agent html in another website’s html using iframe tag. If you have an Internet Service Provider (e.g. GoDaddy) you generally can do those sort of things through the control panel etc. as well and use an easy to read domain name.

Haven’t tried it, but maybe you could do that using https://sites.google.com to create a demo webpage – that is free to use (with caveats).

Remember the agent is really seen as a web service rather than a html hosting site.

So if you do not want someone else to open up the agent html page because you would still be making changes, then the alternative to embedding using iframes tag is to create a mirror site (using google sites for example).

All information requests made from the mirror site to retrieve info from the agent will be the same as those requests from agent html but the agent code can be made to read these calls differently if it has a different path associated with it as previously mentioned by @hugo/ This was you can add a few control functions within your agent code to prevent certain things from happening within the mirror html page hosted elsewhere. This way you have more control over the mirror site compared to the agent site.

I just found this:
https://community.electricimp.com/tag/cookies/

I’m thinking maybe the agent won’t display the pages unless it sees a cookie set on your computer … not your boss’s computer

Out of sheer curiosity, that might be something I should look at a bit closer. This is really different than a server webhost, because of the agent/device relationship. Everything with the imp is “event driven”. It reminds me a lot of a PLC.

Not sure, I did try it using my phone, and it worked there.

I guess I didn’t post that very clear. Some coding will need to be done with the Agent to look for a cookie on the user’s computer or device. You’ll have a cookie, but your boss will not. It won’t matter what the cookie contains, merely the fact that it exists.

What that coding or scripting will be … I’m not sure. But it seems like it should be possible.

Reading through again. I see @mlseim said

It would be nice if the imp utilized cookies or sessions.

Yes it does. Here is an Imp blog post on cookies https://community.electricimp.com/blog/how-to-implement-web-cookies-safely/

Personally I use local and session storage instead of cookies as this is end-user device specific, so you can check and control each and any end-user device opening up the agent html. Here is an useful explanation with examples http://www.w3schools.com/html/html5_webstorage.asp

Within the w3schools link it explains both local storage, which remains on the device and can be referenced if person returns back to agent hrml and then sessionstorage which clears once you leave the site (a bit like a cookie).

well, there’s the answer. it can be done.

yes, will give that a try. But would it not be better to simply be allowed to renew or change the ID via the IDE?

I believe those agent ID’s have to be unique as each of the +500,000 imps out there somewhere have a unique agent ID. Mind you, I’m sure the reason for not allowing changes is more administrative and reliability driven than technical.

thanks @gerriko I wasn’t aware of local storage with HTML5 (HTML is not really my thing). I’ve been using cookies or passing session keys in the url up until now. Does the fact that it’s domain specific mean that ALL agents will have access to the storage?

@coverdriven. Yes I’ve found that to be the case. All agent URL’s opened on an end-user device will be able to read what is stored in the storage on that device. But the good thing with local storage is that there is plenty of space available to create unique encrypted key-values etc. for each agent if needs be.

You could do this: create a new account, blinkup the device to that account, and copy & paste the code over. The same device will now have a different ID (IDs are specific to account AND device ID, not just device ID).

You can then give them the agent URL for the “burner” account.