Page 1 of 1

Search Engine Friendly URLs / Shopping Cart / PHP Question..

Posted: Fri Oct 04, 2002 9:25 am
by superwormy
I'm all outa ideas, hopefully someone here has something that can help me. I wanted to build a PHP shopping cart, and website that would be driven by MySQL. So I got everything working pretty well for the most part, even using Search Engine Friendly URLs ( ie no query strings )

So my URLs look like this:

href="index.php/user/2398525"

Or somethign similar, where 2398525 is a randomly assigned UserID which gets passed to every page through the URL.

The problem I thought of, is that when search engines index my pages, they will be indexing whatever UserID they have, and then when people find my pages in search engines, everyone that comes from the search engine will have the same damn UserID... ie they will all be going to index.php/user/[whatever userid the search engine had when it spidered website]

Which means that a lot of users could end up with the same UserID... which could cause problems in people putting things in others shopping carts and such...

Can anyone think of a way to get around this? To fix this? If I could tell it was a search engine, I could just not use a UserID for it... anyway to do this?

Thanks!

Posted: Fri Oct 04, 2002 9:37 am
by jason
Don't pass the session ID in the URL.

Posted: Fri Oct 04, 2002 10:18 am
by superwormy
Then I'd have to use Cookies... which I didn't want to do...

Unless you have a better solution?

Posted: Fri Oct 04, 2002 10:40 am
by nielsene
Then store two things in the URL, the sessionID and a timestamp. If the timestamp is too old, direct to some welcome page. This will stop search engine redirects from going to the wrong place. If you want to stop users from manually editing these values, you'll want to also in a MAC generated with a constant server side secret.

Detect search engine URL's

Posted: Sat Oct 05, 2002 12:02 pm
by kawika
You can also detect the incoming URL or IP and ignore the sessionid if it's say search.yahoo.com.