I have written a function to secure session it works fine with firefox but not working with google chrome