How can I identify the user without registration? - identity

I have a situation when some users can add a comment on my website without registration. For such a scenario, it will be helpful to identify the user that visits the website. I don't need it personal info, only some identifier that is always the same (something like MAC-Address).
I found some technology, that calls fingerprint https://github.com/fingerprintjs/fingerprintjs. But suddenly it works not 100% correctly.
This is my example made on React JS with fingerprintjs https://fingerprint-317c5.web.app
if I put the name, save, and then change the browser -> fingerprint doesn't work more
if I put the name, save, and then clean the cache in the browser -> fingerprint doesn't work more
Do you have any idea how can I get some unique info about the person (in this case unique ID of the device) that is always the same?
Thanks a lot!

Related

Subdomain of website for Github pages project

I have a Github project, github.com/jeti/matrix, and I set up a "Github pages" site for the project so that it is accessible here jeti.github.io/matrix/.
That is all configurable through Github.
Now, I would like to add a subdomain of my personal website so that the website is accessible via the subdomain matrix.jeti.io of my website jeti.io.
I am just really confused how to do that because the documentation don't seem to show how to redirect a project page to a subdomain. I have tried a few permutations of what I think should be the correct inputs, but because these DNS changes take so long to propagate, it is really hard to test.
Specifically, I would like to know what value to enter into Github as the Custom domain (it seems to me that this should simply be the subdomain matrix.jeti.io, but I am not sure, so I have left this blank):
Then I also need to create the subdomain. I bought the domain through OVH, and they provide a few options for adding a DNS entry:
My understanding is that I need to add 2 apex records. I did that already:
What is unclear to me is whether I also need to add a CNAME entry. This is what the form looks like when I try to add a CNAME entry:
So in recap:
I did not specify the Custom Domain on the Github site.
I created the 2 apex records shown above.
I did not create a CNAME entry.
Please tell me which of these steps needs to be changed and how to modify it.
After more trial and error, the answer seems to be
The Github custom domain should indeed be matrix.jeti.io
I did not need the apex records. In fact, Github emailed me discouraging it. So I deleted the apex records.
In OVH, I added a DNS CNAME entry like this:
The thing that was confusing me is that I thought that the CNAME entry needed to have a link to the original Github pages WITH the project name jeti.github.io/matrix. That was wrong. The target is simply jeti.github.io. (Note the period on the end).

localStorage same index name in another app

Im' developing an app with ionic/cordova and have used the localStorage for many times.
For example I have such a thing:
window.localStorage['is_user_paid'] = 1;
So, if user pay the money, I set this localStorage item.
Now, if another app set this to 1, and run in the device, does my app assume the user is really paid? Is it necessary to use an app key like 2afjx8y_is_user_paid ? Any idea?
When running under Cordova, localStorage is sandboxed to your app; no other apps can see the content within your app's localStorage, nor can they change the contents. Likewise, your app can only see its own localStorage contents.
Now, sandboxed does not mean not readable/editable by the user, however, which is why it is vitally important not to store things like passwords in localStorage -- the file itself is mostly human-readable and easily accessible by your end user. However, apps are prevented from accessing any localStorage other than their own.
Note: there are ways around this when apps from the same company need to share data, but they involve a different storage mechanism.)
I got around this once upon a time by creating a unique identifier within my app (stored not in the code but in the datastore), and I would use it whenever accessing local storage.
The code is predictable enough, the logic is what's important:
Create a value in your datastore (or a file that isn't readable via a URL, like in the GAE that might be an app.yaml file, or whatever) that you use as unique ID. You can do this by hand if you have to. Generate a GUID of some kind and just store it. Don't put it in your dev code or hardcode it into a JS page, make sure it's off to the side (unless you don't care, but you probably should).
Whenever you access local storage, either to get or put, run it through a function that retrieves that info (or already retrieved it as part of bootstrapping the app, whatever works for your context), and just prepend it to whatever you're calling your key.
That way you can continue coding as if you're just using an easy to understand key, like 'user_name', but the stored/retrieved key will look like "abd12342Baa345324w3423sdfs323DD_user_name".
From time to time, if so inclined, you can change that key, set up your code such that if it retrieves 'user_name' with the old key, you swap it out for the new one and continue your ops as usual.
I did this at work for an app in production and all around it was considered a legit way to go about it. I got the approach from a GAE article that shows how to store and retrieve client tokens for Google Login without putting them in your code; you can even store different versions of that UID for dev/qa/prod and whatever else. It's not specific to GAE, the concept should pan out to any environment.
Of course, if another developer on that project decides to use that same function and same GUID, then the problem just moves. A little discipline can clean that up though, I put in a comment above that util function and we never have a problem.

Website Images dont get loaded, URL looks cryptic

So on a website Iam working on some images dont get loaded.
The console says: Failed to load resource: net::ERR_NAME_NOT_RESOLVED
and then a link like that:
http://s234127563.online.de/wp-content/uploads/2014/04/myimage.png
If I change the first part of the URL http://s234127563.online.de/ to the actual URL http://example.org/ the images get shown
Does anybody know what this problem is about? Maybe some DNS thing or something. I tried different browsers and to renew my ip address and flush dns etc. but nothing changed
Looks like a mismatch in your database. WordPress stores your base URL to generate permanent links etc.
Change the URL stored in WordPress. There’s a page dedicated to that on the WordPress Codex. Hardcoding the URL in wp-config is most reliable, but perhaps not most desired.
The URLs are saved in posts etc, so you may have to update those. The Velvet Blues Update URLs plugin can do this for you.
Manually update non-default fields (theme options, custom fields, etc)
If none of the above works... are you using a CDN of some sort?
Check your database. In the wp_options table there should be 2 rows, one called siteurl and the other one called home. Make sure both are set to be your domain name, so http://example.org/
Wordpress sets this URL at the start during installation, and if you for example had this URL set to something different before, in case of a migration to a different domain name or something else, it can differ from the domain name the website is currently being shown on.

Fetch data from second table based on first table

I'm new to the world of databases and I've just started making my first DB powered site with php and MySQL.
I've got it working with data from one table but now I need to get a url to the users school, which is in a second table. Based on which school the user has saved in the first table. Everytime I try this method: http://www.w3schools.com/php/php_mysql_select.asp inside the registered.php the whole page goes blank. The connection to the database is made from a connect.php file which I included in both index.php and registered.php
Explanation, the user logs into the page at index.php, that page sets a cookie with the users school which it gets from the users table. The user gets redirected to registered.php where I want to get the school's url (and some more things) for the users school. It's very hard to explain, I hope you get it..
Thanks in advance!
I'd say that you have a problem in your PHP and not the database... you have some syntax error in your code and that's why you see a blank page. If you're doing this on your own machine, for development and debugging purposes you can configure PHP so that it prints errors out directly to the screen when you open the page in your browser instead of to the log.
You should also probably rethink your design as you should probably not store user details into a cookie (why not in $_SESSION, for example?), but I don't think that's a subject for this board...

protect webpage with question

i want to share something with a specific group of people.
the way i want to do it is: before the page is loaded , i prompt a question to the viewer , if the answer is right , then the page is loaded, if the answer is wrong , the user is turn to the warning page.(i want to avoid the registration process, a specific question is ok)
but there is a problem with this : every time the page is reloaded , the user have to type the answer again?
is there anyway that i can avoid this ?
(I assume you don't know how sessions work because you look new to StackOverflow) No, PHP (or other modern server technologies like ASP) have a session system that allows multiple users be online at same time. The server stores session variables in files, one per user. See http://ca2.php.net/manual/en/intro.session.php
You might also be interested in using Apache's .htaccess files to control access: http://httpd.apache.org/docs/2.0/howto/auth.html
(for questions about using .htaccess, check ServerFault)
First, I wouldn't recommend your approach for anything more than a trivial scenario. That being said, you would want to write a page that serves as your security page. On postback, validate the answer, set a session variable, and redirect to the protected page. The protected page should do a check during its load on that same session variable and redirect to the security page if the user has not answered the security question.