how to destroy a session in the proper way.

if you use session['user'] = nil then it will only remove the session for the user session variable.

instead of that put reset_session and it will remove every session information