* Teriwap how to add the code clean cookies on this xtscript?

<!--parser:xtscript-->
# Get the username from the form
get username

# Check for a cookie or default to the entered name from the form
var $username = call cookie::get $name=mycookie;$default=$username

# If the username is set refresh or create the cookie and output the username
if $username
call cookie::set $name=mycookie; $val=$username; $expire=99999999;$force_current=1;
print <span class="">$username</span>
else

# Show the form
var $self=<xt:url />
print {{
<form action="$self" method="post">
<input name="username" />
<input type="submit" />
</form>}}
endif
<!--/parser:xtscript-->
2015-01-29 21:04 · (0)
* Graham * Teriwap To delete a cookie
<a href="?delete=1">Delete cookie</a>
<!--parser:xtscript-->
get delete
if delete
call cookie::delete $name=mycookie;
endif
<!--/parser:xtscript-->

Copy code

Also if I remember right setting the $expire to -1 will also clear a cookie
2015-01-30 00:56 (edited 2015-01-30 01:00 by Graham ) · (0)
* Teriwap * Graham ok, thank you :) , I want to try first
2015-01-30 02:04 · (0)

Online: Guests: 1