Forum Moderators: open

Message Too Old, No Replies

Sharing Info Between Two or More Sites

How can it be done with plain ASP?

         

HyperGeek

5:12 pm on Apr 9, 2003 (gmt 0)

10+ Year Member




For instance, when a user registers, I want them to be able to log in to either of the two sites that I developed.

Another reason for wanting to do this is that I also want to avoid duplicate accounts or forcing the client to go through two separate sign-up processes.

Is this possible?

jpjones

5:30 pm on Apr 9, 2003 (gmt 0)

10+ Year Member



Yes, it's possible.
I've set this up, so one user has access to three sites.

The key is to use a single database (or maybe a text-file) for both sites. Your signup process (on either site) writes the information into the one table, and then the client can log in from either site using their information.
You could then set cookies to keep them logged in - so effectively they only have to log in once on each site. (This, however, could lead to security issues.)

If both your sites are hosted on the same server, then this suggestion should not be a problem. If they are hosted on separate servers, then you'll have to have one server which holds the database, and then the secondary server will have to poll the database remotely for the information.

HTH,
JP

ziggystardust

5:37 pm on Apr 9, 2003 (gmt 0)

10+ Year Member



Are you using the same database for both/all sites? It should be quite easy then.

If you want to have one universal login page for all of the sites, just make them chose one of the sites(with a radio button) and then redirect them after authetication.

Makes sense? I don't know. ;)
I hope I answered your question.

//ZS

ziggystardust

6:31 pm on Apr 9, 2003 (gmt 0)

10+ Year Member



Gee, it took me 7 min to type that? Hehe. I'm not very fast.

HyperGeek

9:09 pm on Apr 9, 2003 (gmt 0)

10+ Year Member



How is it possible to get one site set a cookie for another?
I didn't think this was possible.

My user authentication sets certain session and client-side variables up when they log in.

My dilema is that I can't envision a way to do this because I'm under the impression that you cannot share cookies or session varibles between two seperate sites.

ziggystardust

9:42 pm on Apr 9, 2003 (gmt 0)

10+ Year Member



Redirect them to a page on the other server, pass whatever data you need in a querystring, and set the cookie there (then redirect to another page of course)?

One solution to the security issue this involves could be dedicating a field in the table for a one-time-checksum.
An impossible to guess, random number you create and store in the DB every time someone successfully logs in on the universal page. Pass that checksum and the userid to the page on the other server and verify it. If it's a match, consider it to be a valid login and set the cookie. After use, reset the checksum.