Re: Redirecting to the same webspace but different domain



Lisa wrote:

> I have a website which amongst other things has a message forum which
> uses cookies to allow users to login. I am in the process of changing
> the domain of the site and ideally want the old address to automatically
> redirect to the new one so that cookies will be created and read for the
> new site address.

This isn't something that can be sensibly handled with HTML.

On the old domain:

1. Generate a one time only authorisation token.
2. Store the cookie data on the server with the token.
3. Send a 301 Redirect HTTP response to the user along with a location
header that redirects them to a server side on the new site. Include, in
the query string of that URL, the auth token and the page they were trying
to visit.

On the new domain (in the aforementioned server side script):

1. Use the auth token to look up their credentials in the database
2. Send a 302 redirect response which includes headers to set their cookies
and redirect them to the page they were trying to get to in the first place
(although on the new domain)
3. Delete the auth details from the database

(This does assume that when you say "changing the domain" you don't mean
"changing the domain and server". Coping with transmitting the
authentication details to the new server as well will make things a little
more complicated).

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
.



Relevant Pages

  • Re: Forms Authentication
    ... I don't want to implement windows auth because of the pop up window. ... dev/test machine but worked properly on the W2000 server. ... On the first page about Cookies: ... > set the cookie and redirect to your main page? ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: Prevent logon form display if cookies disabled
    ... without going through the server and trying to read the cookie back on ... can test for cookies, but was asking how to bypass the page if they're ... but I found out how: I use the onload function in ... to test for cookies and redirect to another page automatically if not ...
    (comp.lang.javascript)
  • Re: Absolute ReturnUrl in Asp.Net 1.1
    ... > the browser won't share cookies between servers unless they have a common ... A login server y other server, ... >> when not authenticate user to access server2 this user is redirect to ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Newbie with a smallbiz2000 installation, check my config?
    ... > Windows creates a profile path under Documents & Settings. ... > a folder with that name already exists (maybe a local user with the ... > server, open the properties for this folder, and ensure that you have ... > you redirect key folders from a user's profile to a location on your ...
    (microsoft.public.backoffice.smallbiz2000)
  • Re: How to intercept error when httpRuntime maxRequestLength is ex
    ... "Hermit Dave" wrote in message ... > client side javascript and http module which could be helpful.. ... > To redirect the client your server has to send back a response. ...
    (microsoft.public.dotnet.framework.aspnet)