exit shell from a script

hi guys

I have a script that I need to terminate or exit the shell or session completely for the user but the exit only exit from the script and takes the user to the shell

I found this

saying that a kill -1 -1 works but is that secure?
is there another way?

thanks a lot

---------- Post updated at 08:28 PM ---------- Previous update was at 08:13 PM ----------

I think I found it guys

since when this user logs in the script will load
I had added script_name in .bashrc

ok adding

exec script_name

did the trick

Glad you were able to find the solution