On Tue, May 18, 2010 at 04:15:31PM +0200, Damien Hardy wrote: > Hi all, > > I have a request from my users: > > We want iphones (hdr_sub(user-agent) -i iphone) to be redirected to Apple > store the first time thez come on our site. but only 1 time per days. > > So I want to user the "redirect" directive > > acl iphone hdr_sub(User-Agent) -i iphone > acl seen hdr_sub(cookie) SEEN=1 > redirect location http://itunes.apple.com/us/app/myapp/ set-cookie SEEN=1 > if iphone !seen > > But how to set the cookie : expires=/TOMOROW/ ?
For this you should use the Max-Age attribute which takes an expiration value in seconds. It's not included in the redirect mechanism, but you should be able to use a trick to force it in the set-cookie value : redirect location http://itunes.apple.com/us/app/myapp/ set-cookie SEEN=1;Max-Age=86400 if iphone !seen Regards, Willy

