anti forgery and initialize data connection