Jump to content

Recommended Posts

Posted

I need to set expiry time of say 30 mins on my clients browser and i ve used the following possible codes to do it :

# ini_set('session.cookie_lifetime',time()+30);

#setcookie('user_id','1',time()+10);

 

and many more but later i found out that it depends on the setting of :

session.cookie_lifetime value set in php.ini file of server.

So may i know how do i change settings so that i ll be able to set cookie expiry time as i want and not till session expires.

Currently whenever i set a cookie,its default expiry time is "till session expires".

 

I am using browsers: IE9.Firefox 4 and chrome for testing and al give the same results.

Kindly suggest moves

Guest Geoff
Posted

You should not depend on the client's cookie expiration. You should instead verify the cookie server-side.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...