0

I want my cookies expire after an hour. I'm doing it in classic asp and I am a newbie.

I have tried this;

Response.Cookies("NumVisits").Expires=dateadd("h", 1, now())

but it's not working.

user692942
  • 15,667
  • 7
  • 74
  • 164
user3391775
  • 1
  • 1
  • 1

2 Answers2

1

it works fine for me

Response.Cookies("NumVisits").expires = dateadd("n",+60,now())
Boopathi Rajan
  • 1,174
  • 14
  • 37
  • still never work for me. Here is my full code – user3391775 Mar 07 '14 at 09:17
0

Change your code to the following:

<% 
dim numvisits 
numvisits = 40 'Get the number of visits
Response.Cookies("NumVisits") = numvisits
Response.Cookies("NumVisits").expires = dateadd("n",+60,now())
%> 
<body>
<% if numvisits= "" then 
   Response.Cookies("NumVisits")=1 
   else %>
<script> 
$(function() { 
    $('button,input[type=submit]').attr('disabled',true); 
});  
</script>
<% end if %> 
<button>hello</button> 
</body>
meda
  • 44,540
  • 14
  • 88
  • 122