Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 307
  • Last Modified:

How to remember the last website I visited

Hi, Experts,
I have this question, I have two websites, one is english version and another one is other language version. A user will come to my english site first, if this user want to visit the " other language" site, this user click a link to the " other language" website. How can I write a script which will remember this user's very last visit ( which is the " other language" site ) and not to my english site. Is it about cookie ?

Sincerely,
0
Brian Lin
Asked:
Brian Lin
  • 4
  • 4
  • 2
1 Solution
 
sajuksCommented:
You need a cookie to store his/her preferences.
When the user enters the url again you can read from the cookie his preference and redirect to the appropriate page
0
 
webtransCommented:
yes it would be about cookies for sure
and you can make it in JS or ASP or PHP
whatever is best for you
which would you prefer
i can send u any sample
0
 
Brian LinDesignerAuthor Commented:
i would like JS. or ASP ? what is the difference ?

thanks
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
webtransCommented:
asp would be using
response.cookies("cookiename") to write the cookie
and request.cookies("cookiename") to read the cookie
then a response.redirect to move him to the folder you like or even server.transfere
refere to this for more info
http://www.w3schools.com/asp/asp_cookies.asp
0
 
Brian LinDesignerAuthor Commented:
I am not very good at it, could you kindly provide a sample script ?

thanks
0
 
Brian LinDesignerAuthor Commented:
this is great, thanks
0
 
sajuksCommented:
Thanks for the points and grade.
0
 
Brian LinDesignerAuthor Commented:
one last Q, I saw the code
<html>
<head>
<script language="JavaScript" src="cookieLibrary.js"></script>
<script language="JavaScript">
// check to see if cookie exists
// if yes, redirect to language page
if (GetCookie("lang") == "EN")

Do I need to download "cookieLibrary.js" ?
0
 
sajuksCommented:
Yes the cookie script can be obtained from
http://www.cookiecentral.com/code/cookie.txt ( save it as the .js file )
or you can take it from
http://javascript.internet.com/cookies/name.html
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 4
  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now