Jump to content

Recommended Posts

hey guys,

 

i need a little help on the best way to generate a seo friendly token...at the moment i use password_hash() with a peice of users information to create a key so that the user can verifiy account by a url sent via email.

 

now the problem i'm having with that is it contains forward slashes which is killer for my uri and not to mention all the other seo friendly characters it conatins.

 

how do i make the hash url friendly?...any advise would be great

 

thank you

Link to comment
https://forums.phpfreaks.com/topic/293593-seo-friendly-token/
Share on other sites

since search engines won't ever post data to your site, they should never get to the point of seeing one of your links containing an account verification token. it doesn't matter if the url is seo friendly or not.

 

also, the token should be completely random and not tied to any user specific values.

 

if you have the openssl_random_pseudo_bytes() function available, it is the current recommend method of generating a chosen length, random token.

Link to comment
https://forums.phpfreaks.com/topic/293593-seo-friendly-token/#findComment-1501468
Share on other sites

since search engines won't ever post data to your site, they should never get to the point of seeing one of your links containing an account verification token. it doesn't matter if the url is seo friendly or not.

 

also, the token should be completely random and not tied to any user specific values.

 

if you have the openssl_random_pseudo_bytes() function available, it is the current recommend method of generating a chosen length, random token.

 

i did a bit of reading on the openssl_random_pseudo_bytes() which seems just the thing i need thank you.

 

now i've never dealt with ssl before and im about to buy a certificate...but im not sure what certificate i need to buy if anyone can please help?

 

https://www.ssls.com/comodo-ssl-certificates/

 

now i need a wildcard so i can use the cert on pages such as login and register (dont know what else) but there are so many different name types and different validations...confused!

 

any help would be great thanks guys

Link to comment
https://forums.phpfreaks.com/topic/293593-seo-friendly-token/#findComment-1501623
Share on other sites

if your mention of getting an ssl certificate has anything to do with the suggestion of using openssl_random_pseudo_bytes(), there is no need for an ssl certificate to do so.

 

you only need an ssl certificate if you are going to have visitors connect to your site via an encrypted connection - https://your_domain.com

Link to comment
https://forums.phpfreaks.com/topic/293593-seo-friendly-token/#findComment-1501624
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.