Sometimes we want to restrict users from repeatedly refreshing a page. Many sites use verification codes for entry operations to limit malicious spamming. But if it is in a web management system and a logical operation code without an interface is executed, the verification code cannot be used. We generally use session to limit. The following is a wrapped function, which is very simple to use.
'Operation restriction function
'Snow production in Saibei
'www.downcodes.com
'SessionName session name
'SecondSpan time interval (unit: seconds)
function CanDoRepeat(SessionName,SecondSpan)
xx=timer()
if session(SessionName)="" then
session(SessionName)=xx
else
if xx-session(SessionName)<SecondSpan then
CanDoRepeat=false
else
session(SessionName)=xx
CanDoRepeat=true
end if
end if
end function