Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Set cookies - how?

Status
Not open for further replies.

Lenzcuvasch

Technical User
Mar 16, 2002
25
0
0
MY
Hi,

I have a page. And how it supposed to work is that once someone have visited that page, he can't re-visit it again - even with 'back' button. It'll display a message 'you are not allowed to revisit this page'

I suppose it had something todo with cookies

Thanks to anyone who is willing to help.

Fariz
 
Thi smay give you a chance to pick it apart and achieve what you want

===========================

<%@ Language=VBScript %>
<%
If Session(&quot;been&quot;) <> &quot;&quot; Then
Response.Write &quot;Sorry you can not visit this page again&quot;
Else
Session(&quot;been&quot;) = &quot;been_here_before&quot;
%>
<HTML>
<BODY bgcolor=&quot;#FFFFFF&quot; text=&quot;#000000&quot;>
First Time here...(Your own page in here)
</BODY>
</HTML>
<%
End If
%> Live long and make your kids suffer..
 
You don't. Once the user has been to the page once, the session variable is set, so if they return or refresh the message will be written. Derren
[Mediocre talent - spread really thin]
 
On another page
Session(&quot;been&quot;) = Nothing Live long and make your kids suffer..
 
no prob you may help us sometime :) Live long and make your kids suffer..
 
Just to give you a better understanding on the difference between session and cookies:
Cookies are-client side which reside on the clients computer. They're mainly good for containing specific information on the activity of the persons purchase, etc. They have the option to be disabled and when it comes to security, are extremely unsafe, especially if you share your pc with others. They create files on the clients computer that are not encrypted and can be read by anyone.

Session are server-side which reside on the server being used. They do not have the option to be turned off by the user and can be passed through as many pages as you wish! You can drop Sessions within a page (Session.Abandon) or they abandon themselves automatically when you shut down your browser. Overall, they're quite safe and are the best to use when passing specific information from page to page.

Now that I'm done being a teacher, I can get on with my project. Hope that cleared things, if not, atleast I got to test my knowledge! ;o)

Candie
 
Just to give you a better understanding on the difference between session and cookies:
Cookies are-client side which reside on the clients computer. They're mainly good for containing specific information on the activity of the persons purchase, etc. They have the option to be disabled and when it comes to security, are extremely unsafe, especially if you share your pc with others. They create files on the clients computer that are not encrypted and can be read by anyone.

Sessions are server-side which reside on the server being used. They do not have the option to be turned off by the user and can be passed through as many pages as you wish! You can drop Sessions within a page (Session.Abandon) or they abandon themselves automatically when you shut down your browser. Overall, they're quite safe and are the best to use when passing specific information from page to page.

Now that I'm done being a teacher, I can get on with my project. Hope that cleared things, if not, atleast I got to test my knowledge! ;o)

Candie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top