tags:

views:

19

answers:

2

how to maintain the cookies for a long duration of time even if the user logout from the site and when user login next time the earlier set of cookies should be there

A: 

If you just want cookies that experiences after a given duration you just use that:

setcookie(name, value, expire, path, domain); 

where expire can be for example time()+60*60*24*$days.

Cedric H.
he wants cookie that has no expiration date or very long expiration date, so it is no help.
Tomasz Kowalczyk
Maybe, but that's not clear at all... 'for a long duration of time even if the user logout from the site and when user login next time the earlier set of cookies should be there', nothing is said about 'no expiration date'...
Cedric H.