Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Update:</p> <p>For something like a single use URL, I'd go with the GUID-esque appoach that has been suggested. Make sure to have a short lifespan on the link.</p> <p>For a instant log-in, there is no really secure way to have a single URL.</p> <p>Yes you can generate a URL which is going to be damn near impossible to guess, but that doesn't give you super security. If you want to remember users, why not use an encrypted authentication cookie?</p> <p>The example you give, Google Calendar doesn't log you in via the URL alone, you have to be authenticated first before the URL means anything.</p> <p>E.g. clicking on google calendar from my gmail gives me:</p> <p><a href="https://www.google.com/calendar/render?tab=mc&amp;gsessionid=-LTeHrnKoeAbDcVaN68NHA" rel="nofollow noreferrer">https://www.google.com/calendar/render?tab=mc&amp;gsessionid=-LTeHrnKoeAbDcVaN68NHA</a></p> <p>That doesn't help you access my account unless you've first authenticated as me.</p> <p>Old post:</p> <p>You can generate a GUID in PHP using <a href="http://uk.php.net/com_create_guid" rel="nofollow noreferrer">com_create _guid</a> and use that.</p> <p>On linux I think you can use <a href="http://manpages.unixforum.co.uk/man-pages/unix/freebsd-6.2/3/uuid_create-man-page.html" rel="nofollow noreferrer">uuid_create</a>, or this code from <a href="http://algorytmy.pl/doc/php/function.com-create-guid.php" rel="nofollow noreferrer">here</a>:</p> <pre><code>&lt;?php function guid(){ if (function_exists('com_create_guid')){ return com_create_guid(); }else{ mt_srand((double)microtime()*10000);//optional for php 4.2.0 and up. $charid = strtoupper(md5(uniqid(rand(), true))); $hyphen = chr(45);// "-" $uuid = chr(123)// "{" .substr($charid, 0, 8).$hyphen .substr($charid, 8, 4).$hyphen .substr($charid,12, 4).$hyphen .substr($charid,16, 4).$hyphen .substr($charid,20,12) .chr(125);// "}" return $uuid; } } echo guid(); ?&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload