Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

How to remember the last website I visited

Posted on 2004-09-14
10
300 Views
Last Modified: 2011-09-20
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
Comment
Question by:mingchih
  • 4
  • 4
  • 2
10 Comments
 
LVL 33

Expert Comment

by:sajuks
ID: 12052644
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
 
LVL 5

Expert Comment

by:webtrans
ID: 12052648
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
 

Author Comment

by:mingchih
ID: 12052651
i would like JS. or ASP ? what is the difference ?

thanks
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 5

Expert Comment

by:webtrans
ID: 12052660
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
 

Author Comment

by:mingchih
ID: 12052730
I am not very good at it, could you kindly provide a sample script ?

thanks
0
 
LVL 33

Accepted Solution

by:
sajuks earned 500 total points
ID: 12052737
0
 

Author Comment

by:mingchih
ID: 12052745
this is great, thanks
0
 
LVL 33

Expert Comment

by:sajuks
ID: 12052754
Thanks for the points and grade.
0
 

Author Comment

by:mingchih
ID: 12052793
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
 
LVL 33

Expert Comment

by:sajuks
ID: 12052850
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: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

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

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question