javascript - CSRF token null in IE 11 while everything is fine in Chrome using Angular 2 and SpringRest -
i new angular2, using xsrfstrategy csrf token.
here typescript code :
export class myxsrfstrategy implements xsrfstrategy { _cookiename :string = 'xsrf-token'; _headername :string = 'x-csrf-token'; configurerequest(req) { const xsrftoken = ɵgetdom().getcookie(this._cookiename); console.log("csrf token--->>"+xsrftoken); if (xsrftoken) { req.headers.set(this._headername, xsrftoken); } } }
here csrf token printing null in logs
spring rest code :
@override protected void configure(httpsecurity http) throws exception { cookiecsrftokenrepository cctr=new cookiecsrftokenrepository(); cctr.setcookiehttponly(true); http.addfilterat(casauthenticationfilter(), basicauthenticationfilter.class) .cors() .and().csrf().csrftokenrepository(cctr); }
above code working fine in chrome version 56.0.2924.76. but not working in ie11.
here cookie information snapshots same :
snapshot chrome version 56.0.2924.76.
please me find issue , issue in code.
Comments
Post a Comment