Cookie expiry

Hi,
In my current project i am facing issue with cookies as they expire in 24 hrs,The script which i create today doesnt work the next day,i tried to correlate them and removing them by web_cleanup_cookies() and changing there expiry date but none of the above worked,Please help me how to handle them.Script is attached pls have a look at it