Skip to main content
Home
Live to Learn!

Main navigation

  • Home
  • Learn
    • FoxPro
    • MS-DOS
    • C PRG
    • Java
    • ASP
    • Ruby on Rails
    • ASP.NET
    • E-Books
    • Exam Preparation
    • Tools
  • Blog
  • Forums
  • Contact
User account menu
  • Log in

Breadcrumb

  1. Home
  2. ASP Programs

Cookies Manipulation

Book navigation

  • Displaying a message according to the time of a day and weekday.
  • Cookies Manipulation
  • Ad Rotator in ASP
  • Example Forms - Course Registration
  • Select, Insert, Update, Delete Records in Database - Employee
  • Login form with Timeout
By Karthikeyan , 19 August, 2012

Storing and retrieving data in Cookies..


<%
if request.cookies("numvisits")= "" then
numvisit = 1
response.cookies("numvisits")("num")= 1
response.Cookies("numvisits")("date")= date 
response.Cookies("numvisits")("time")= time
else
response.cookies("numvisits")("num") = request.Cookies("numvisits")("num") + 1
numvisit = request.Cookies("numvisits")("num")
lastdate = request.Cookies("numvisits")("date")
lasttime = request.Cookies("numvisits")("time")
response.Cookies("numvisits")("date")= date 
response.Cookies("numvisits")("time")= time
end if
%>

Cookies Manipulation Cookies Manipulation <% if numvisit = 1 then %> Welcome, You are visiting the web page first time, <% else %> Thanks for visiting the web page again

<%=response.Write(numvisit)%> times u visited this web page
<% end if %> <%if numvisit > 1 then %>
Your last access to this web page was <% = Response.Write(DateDiff("s", lasttime,request.Cookies("numvisits")("time")) ) %> seconds Ago at <%=response.Write(lasttime) %>
on <% =response.Write(lastdate)%>
<% end if %>

Comments

Featured Blog Posts

Convert Currency in Number to Words (Indian Rupees) - MS Excel
Foxpro Tutorial and Programs
Convert Currency in Number to Words in MS Word
Convert Currency in Number to Words (Indian Rupees) - Version 2
Best way to Use Rupee Symbol in Windows – Easy steps
Convert Currency in Number to Words - MS Access
Creating All in One Windows XP DVD with all Important Applications
RSS feed

© 2009-2025 Live to Learn.In

Terms of Use | Privacy Policy