View Full Version : Help: JavaScript & Cookies to automatically redirect

05-11-2009, 05:06 PM

I'm looking for some urgent help/pointers as I'm really stuck and have a couple of hours to get this working.

I have a homepage (in asp) I want to display that changes for 8 different areas (passed homepage.asp?id=X)

I already have this working via a jumpmenu but I also want a cookie to log the area selected and save it so ever time they log on they get the same area.

- Select your area (does nothing)
- Area 1 (temporarily flicks to area 1)
- Area 8 (temporarily flicks to area 8)
- Reset your Homepage

On the first page load I want to display a selection of 8 images to choose the area from, save the cookie and load that page.

When the Reset option is picked (homepage.asp?id=reset) then I want to to clear the cookie and bring up the section images again.

Can anyone please help me or point me to a example on the net I could use?

in short:

part 1.

* If url = homepage.asp
* load cookie
* if cookie has area saved
* load page homepage.asp?area=x

part 2

* if no cookie or url = homepage.asp?area=reset
* then show link buttons for each area and create new cookie.

How can I do this?