-1

i am using php codeigniter for building relatively large application where i have to give different log in options for different level of users. And i have done with pretty much everything. I want to clear all cookies and session when the user closes the browser. How can i do this.

Kermit
  • 33,827
  • 13
  • 85
  • 121
crafter
  • 319
  • 4
  • 13

1 Answers1

0

Below is a very basic session set up within the /application/config/config.php file. The variable to be set is

$config['sess_expire_on_close'] = TRUE;

You should however try to RT(F)M.

enter image description here

Rixhers Ajazi
  • 1,303
  • 11
  • 18
  • acc to this link: http://stackoverflow.com/questions/1783302/clear-cookies-on-browser-close?rq=1, it should clear everything by itself, but if the user closes the browser without logging off and if he reopens the browser it directly redirects to loging-success page instead of asking to loging. Why is this so – crafter Apr 21 '14 at 14:50
  • Am I missing something? That is for a framework / program written in c# In CodeIgniter when you set sess_expire_on_close to TRUE your entire session when the browser window is closed is destroyed which means your users will have to login. – Rixhers Ajazi Apr 21 '14 at 15:16
  • Hey, thanks ll try that. i meant these text, " The cookie setter can specify a deletion date, in which case the cookie will be removed on that date. If the cookie setter does not specify a date, the cookie is removed once the user quits his or her browser. " and "Sessions are usualy used for this. According to Wikipedia, when no expiration date is set, a cookie is cleared when the user closes the browser." in that C# ans. anyway, ll try out in php – crafter Apr 21 '14 at 15:18