2014-01-09 2 views
0

스프링 보안 3.1을 사용하려고하는데 인증 후 HttpSession이 손실됩니다. 나 : 올바른 HttpSession을 만든 후에 "현재 HttpSession이 없습니다"라는 메시지가 나타납니다.스프링 보안 : 인증 후 HttpSession이 손실되었습니다.

08 janv. 2014 19:53:59 DEBUG HttpSessionSecurityContextRepository - SecurityContext stored to HttpSession: '[email protected]e8a84f: Authentication: org.springframew[email protected]bce8a84f: Principal: [email protected]: Username: ADMIN; Password: [PROTECTED]; Enabled: true; AccountNonExpired: true; credentialsNonExpired: true; AccountNonLocked: true; Granted Authorities: ROLE_ADMIN; Credentials: [PROTECTED]; Authenticated: true; Details: org.sprin[email protected]ffff6a82: RemoteIpAddress: 127.0.0.1; SessionId: qx1qn1vbjxx71xedid64oi977; Granted Authorities: ROLE_ADMIN' 
08 janv. 2014 19:53:59 DEBUG DispatcherServlet - Null ModelAndView returned to DispatcherServlet with name 'spring': assuming HandlerAdapter completed request handling 
08 janv. 2014 19:53:59 DEBUG DispatcherServlet - Successfully completed request 
08 janv. 2014 19:53:59 DEBUG ExceptionTranslationFilter - Chain processed normally 
08 janv. 2014 19:53:59 DEBUG SecurityContextPersistenceFilter - SecurityContextHolder now cleared, as request processing completed 
08 janv. 2014 19:54:00 DEBUG FilterChainProxy - /index at position 1 of 10 in additional filter chain; firing Filter: 'SecurityContextPersistenceFilter' 
08 janv. 2014 19:54:00 DEBUG HttpSessionSecurityContextRepository - No HttpSession currently exists 
08 janv. 2014 19:54:00 DEBUG HttpSessionSecurityContextRepository - No SecurityContext was available from the HttpSession: null. A new one will be created. 
08 janv. 2014 19:54:00 DEBUG FilterChainProxy - /index at position 2 of 10 in additional filter chain; firing Filter: 'LogoutFilter' 
08 janv. 2014 19:54:00 DEBUG FilterChainProxy - /index at position 3 of 10 in additional filter chain; firing Filter: 'UsernamePasswordAuthenticationFilter' 
08 janv. 2014 19:54:00 DEBUG FilterChainProxy - /index at position 4 of 10 in additional filter chain; firing Filter: 'BasicAuthenticationFilter' 
08 janv. 2014 19:54:00 DEBUG FilterChainProxy - /index at position 5 of 10 in additional filter chain; firing Filter: 'RequestCacheAwareFilter' 
08 janv. 2014 19:54:00 DEBUG FilterChainProxy - /index at position 6 of 10 in additional filter chain; firing Filter: 'SecurityContextHolderAwareRequestFilter' 
08 janv. 2014 19:54:00 DEBUG FilterChainProxy - /index at position 7 of 10 in additional filter chain; firing Filter: 'AnonymousAuthenticationFilter' 
08 janv. 2014 19:54:00 DEBUG AnonymousAuthenticationFilter - Populated SecurityContextHolder with anonymous token: 'org.sprin[email protected]9055e4a6: Principal: anonymousUser; Credentials: [PROTECTED]; Authenticated: true; Details: org.sprin[email protected]957e: RemoteIpAddress: 127.0.0.1; SessionId: null; Granted Authorities: ROLE_ANONYMOUS' 

어떤 문제가 될 수 :

나는 다음과 같은 로그를 받고 있어요?

는 UPDATE :

부두-web.xml의 :

<?xml version="1.0" encoding="UTF-8"?> 
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" 
    "http://jetty.mortbay.org/configure.dtd"> 
<Configure class="org.eclipse.jetty.webapp.WebAppContext"> 
    <Get name="sessionHandler"> 
     <Get name="sessionManager"> 
      <Set name="usingCookies" type="boolean">false</Set> 
     </Get> 
    </Get> 
</Configure> 

내가 비활성화 된 쿠키 나 자신을 내 문제가 발견
... 나는 약 전에 걱정해야 파일을했다

부두-web.xml에 : ... 나는 내 문제를 발견

+0

xml (s)로 업데이트 할 수 있습니까? 예 : spring_context.xml, spring_security.xml ... –

+0

@MayurGupta 제 문제를 해결했습니다. 내 XML 파일을보고 내 쿠키를 사용하지 못하는 것으로 나타났습니다. 감사합니다 – user3175671

+0

오오 그렇습니다 .... 당신은 맞습니다,하지만 당신은 이것을 대답으로 써야하고 그것을 받아 들여야합니다. 같은 문제에 직면 해있는 다른 프로그래머에게 도움이 될 수 있습니다 ... –

답변

0

... 나는 이전에 대해 걱정해야 파일을했다

<?xml version="1.0" encoding="UTF-8"?> 
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" 
    "http://jetty.mortbay.org/configure.dtd"> 
<Configure class="org.eclipse.jetty.webapp.WebAppContext"> 
    <Get name="sessionHandler"> 
     <Get name="sessionManager"> 
      <Set name="usingCookies" type="boolean">false</Set> 
     </Get> 
    </Get> 
</Configure> 

쿠키를 직접 비활성화하고 있습니다.이 파일을 삭제했으며 현재 작동 중입니다.