Expand my Community achievements bar.

Radically easy to access on brand approved content for distribution and omnichannel performant delivery. AEM Assets Content Hub and Dynamic Media with OpenAPI capabilities is now GA.

Sessions problem for Login Module

Avatar

Level 3

Hi All,

I have a one author instance,3 publish instance and 3 dispatchers.

i have a page with login button,the login functionality is working in author instance and 3 publish instances but login functionality is not working in 3 dispatchers

can any one help me why is it not working in dispatchers

Page : http://164.100.222.222/content/it-portal/en/doit/cug.html
USER NAME : VEERA.REDDY.CHILAKAL
PASSWORD  : Veera44$

Thanks & Regards
VeeraReddy.Ch

8 Replies

Avatar

Level 5

Have you used the session management tag like below in dispatcher.any file ? or all required client headers are in place, please double check it.

 

/sessionmanagement
            {
                /directory "<dispatcher path>/dispatcher/htdocs/.sessions"
                /header "Cookie:login-token"
            }

Avatar

Level 3

Thanks for reply,

here is my dispatcher.any file

# Each farm configures a set of load balanced renders (i.e. remote servers)
/farms
  {
  # First farm entry
  /website 
    {  
    # Request headers that should be forwarded to the remote server.
    /clientheaders
      {
      # Forward all request headers that are end-to-end. If you want
      # to forward a specific set of headers, you'll have to list
      # them here.
      "*"
      }
      
    # Hostname globbing for farm selection (virtual domain addressing)
    /virtualhosts
      {
      # Entries will be compared against the "Host" request header
      # and an optional request URL prefix.
      #
      # Examples:
      #
      #   www.company.com
      #   intranet.*
      #   myhost:8888/mysite
      "*"
      }
      
    # Vanity URL allow      
     /vanity_urls 
     {
     /url "/libs/granite/dispatcher/content/vanityUrls.html"
     /file "/tmp/vanity_urls"
     /delay 300
    }   
      
    # The load will be balanced among these render instances
    /renders
      {
      /rend01
        {
        # Hostname or IP of the render
        /hostname "localhost"
        # Port of the render
        /port "80"
        # Connect timeout in milliseconds, 0 to wait indefinitely
        # /timeout "0"
        }
      }
      
    # The filter section defines the requests that should be handled by the dispatcher.
    # The globs will be compared against the request line, e.g. "GET /index.html HTTP/1.1".
    /filter
      {

        $include "filter-publish.any"
       $include "filter-ulb.any"
       $include "filter-uit.any"
       $include "filter-other.any"
       
      }

    # The cache section regulates what responses will be cached and where.
    /cache
      {
      # The docroot must be equal to the document root of the webserver. The
      # dispatcher will store files relative to this directory and subsequent
      # requests may be "declined" by the dispatcher, allowing the webserver
      # to deliver them just like static files.
      /docroot "/rajasthan/cache"

      # Sets the level upto which files named ".stat" will be created in the 
      # document root of the webserver. When an activation request for some 
      # page is received, only files within the same subtree are affected 
      # by the invalidation.
      /statfileslevel "3"
      
      # Flag indicating whether to cache responses to requests that contain
      # authorization information.
      #/allowAuthorized "0"
      
      # Flag indicating whether the dispatcher should serve stale content if
      # no remote server is available.
      #/serveStaleOnError "0"
      
      # The rules section defines what responses should be cached based on
      # the requested URL. Please note that only the following requests can
      # lead to cacheable responses:
      #
      # - HTTP method is GET
      # - URL has an extension
      # - Request has no query string
      # - Request has no "Authorization" header (unless allowAuthorized is 1)
      /rules
        {
        /0000
          {
          # the globbing pattern to be compared against the url
          # example: *             -> everything
          #        : /foo/bar.*    -> only the /foo/bar documents
          #        : /foo/bar/*    -> all pages below /foo/bar
          #        : /foo/bar[./]* -> all pages below and /foo/bar itself
          #        : *.html        -> all .html files
          /glob "*"
          /type "allow"
          }
          
         
          
        }
        
      # The invalidate section defines the pages that are "invalidated" after
      # any activation. Please note that the activated page itself and all 
      # related documents are flushed on an modification. For example: if the 
      # page /foo/bar is activated, all /foo/bar.* files are removed from the
      # cache.
      /invalidate
        {
        /0000
          {
          /glob "*"
          /type "deny"
          }
        /0001
          {
          # Consider all HTML files stale after an activation.
          /glob "*.html"
          /type "allow"
          }
        /0002
          {
          /glob "/etc/segmentation.segment.js"
          /type "allow"
          }
        /0003
          {
          /glob "*/analytics.sitecatalyst.js"
          /type "allow"
          }
         /0004
          {
          # Consider all css files stale after an activation.
          /glob "*.css"
          /type "allow"
          }
        /0005
          {
          # Consider all js files stale after an activation.
          /glob "*.js"
          /type "allow"
          }            
        }

      # The allowedClients section restricts the client IP addresses that are
      # allowed to issue activation requests.
      /allowedClients
        {
        # Uncomment the following to restrict activation requests to originate
        # from "localhost" only.
        #
        #/0000
        #  {
        #  /glob "*"
        #  /type "deny"
        #  }
        #/0001
        #  {
        #  /glob "127.0.0.1"
        #  /type "allow"
        #  }
        }
        
      # The ignoreUrlParams section contains query string parameter names that
      # should be ignored when determining whether some request's output can be
      # cached or delivered from cache.
      #
      # In this example configuration, the "q" parameter will be ignored. 
      #/ignoreUrlParams
      #  {
      #  /0001 { /glob "*" /type "deny" }
      #  /0002 { /glob "q" /type "allow" }
      #  }
      
      }
      
    # The statistics sections dictates how the load should be balanced among the
    # renders according to the media-type. 
    /statistics
      {
      /categories
        {
        /html
          {
          /glob "*.html"
          }
        /others
          {
          /glob "*"
          }
        }
      }
    }
  }

 

 

 

 

Where should i place the 

/sessionmanagement
            {
                /directory "<dispatcher path>/dispatcher/htdocs/.sessions"
                /header "Cookie:login-token"
            }

 

Thanks & Regards

VeeraReddy.Ch

Avatar

Level 5

Try adding below before /invalidate section. Make sure to update the <dispatcher path> in the /directory and also make sure to restart the dispatcher after the changes. You need to check in the dispatcher logs if you are seeing any token related error ?

/sessionmanagement
            {
                /directory "<dispatcher path>/dispatcher/htdocs/.sessions"
                /header "Cookie:login-token"
            }
        /auth_checker
              {
              # request is sent to this URL with '?uri=<page>' appended
              /url "/bin/permissioncheck"
                   
              # only the requested pages matching the filter section below are checked,
              # all other pages get delivered unchecked
              /filter
                {
                /0000
                  {
                  /glob "*"
                  /type "deny"
                  }
                /0001
                  {
                  /glob "*.html"
                  /type "allow"
                  }
                }
              # any header line returned from the auth_checker's HEAD request matching
              # the section below will be returned as well
              /headers
                {
                /0000
                  {
                  /glob "*"
                  /type "deny"
                  }
                /0001
                  {
                  /glob "Set-Cookie:*"
                  /type "allow"
                  }
                }
              }

Avatar

Level 3

Hi,

I have given a directory path like

 /directory "C:/Program Files (x86)/Apache Software Foundation/Apache2.2/htdocs/.sessions"

and I am getting a below error in dispatcher.log file

[Tue Mar 21 12:19:18 2017] [W] [pid 2836 (tid 716)] C:\Program Files (x86)\Apache Software Foundation\Apache2.2\conf\dispatcher\dispatcher.any:151: entry not recognized: 'sessionmanagement'
[Tue Mar 21 12:19:18 2017] [W] [pid 2836 (tid 716)] C:\Program Files (x86)\Apache Software Foundation\Apache2.2\conf\dispatcher\dispatcher.any:156: entry not recognized: 'auth_checker'
[Tue Mar 21 12:19:18 2017] [W] [pid 9088 (tid 200)] C:\Program Files (x86)\Apache Software Foundation\Apache2.2\conf\dispatcher\dispatcher.any:151: entry not recognized: 'sessionmanagement'
[Tue Mar 21 12:19:18 2017] [W] [pid 9088 (tid 200)] C:\Program Files (x86)\Apache Software Foundation\Apache2.2\conf\dispatcher\dispatcher.any:156: entry not recognized: 'auth_checker'
[Tue Mar 21 12:19:18 2017] [W] [pid 9088 (tid 200)] C:\Program Files (x86)\Apache Software Foundation\Apache2.2\conf\dispatcher\dispatcher.any:151: entry not recognized: 'sessionmanagement'
[Tue Mar 21 12:19:18 2017] [W] [pid 9088 (tid 200)] C:\Program Files (x86)\Apache Software Foundation\Apache2.2\conf\dispatcher\dispatcher.any:156: entry not recognized: 'auth_checker'
[Tue Mar 21 12:19:26 2017] [W] [pid 2836 (tid 716)] C:\Program Files (x86)\Apache Software Foundation\Apache2.2\conf\dispatcher\dispatcher.any:151: entry not recognized: 'sessionmanagement'
[Tue Mar 21 12:19:26 2017] [W] [pid 2836 (tid 716)] C:\Program Files (x86)\Apache Software Foundation\Apache2.2\conf\dispatcher\dispatcher.any:156: entry not recognized: 'auth_checker'
[Tue Mar 21 12:19:26 2017] [W] [pid 1708 (tid 716)] C:\Program Files (x86)\Apache Software Foundation\Apache2.2\conf\dispatcher\dispatcher.any:151: entry not recognized: 'sessionmanagement'
[Tue Mar 21 12:19:26 2017] [W] [pid 1708 (tid 716)] C:\Program Files (x86)\Apache Software Foundation\Apache2.2\conf\dispatcher\dispatcher.any:156: entry not recognized: 'auth_checker'
[Tue Mar 21 12:19:26 2017] [W] [pid 1708 (tid 716)] C:\Program Files (x86)\Apache Software Foundation\Apache2.2\conf\dispatcher\dispatcher.any:151: entry not recognized: 'sessionmanagement'
[Tue Mar 21 12:19:26 2017] [W] [pid 1708 (tid 716)] C:\Program Files (x86)\Apache Software Foundation\Apache2.2\conf\dispatcher\dispatcher.any:156: entry not recognized: 'auth_checker'

Avatar

Level 3

# Each farm configures a set of load balanced renders (i.e. remote servers)
/farms
  {
  # First farm entry
  /website
    {  
    # Request headers that should be forwarded to the remote server.
    /clientheaders
      {
      # Forward all request headers that are end-to-end. If you want
      # to forward a specific set of headers, you'll have to list
      # them here.
      "*"
      }
      
    # Hostname globbing for farm selection (virtual domain addressing)
    /virtualhosts
      {
      # Entries will be compared against the "Host" request header
      # and an optional request URL prefix.
      #
      # Examples:
      #
      #   www.company.com
      #   intranet.*
      #   myhost:8888/mysite
      "*"
      }
      
    # Vanity URL allow     
     /vanity_urls
     {
     /url "/libs/granite/dispatcher/content/vanityUrls.html"
     /file "/tmp/vanity_urls"
     /delay 300
}   
      
    # The load will be balanced among these render instances
    /renders
      {
      /rend01
        {
        # Hostname or IP of the render
        /hostname "localhost"
        # Port of the render
        /port "80"
        # Connect timeout in milliseconds, 0 to wait indefinitely
        # /timeout "0"
        }
      }
      
    # The filter section defines the requests that should be handled by the dispatcher.
    # The globs will be compared against the request line, e.g. "GET /index.html HTTP/1.1".
    /filter
      {

        $include "filter-publish.any"
       $include "filter-ulb.any"
       $include "filter-uit.any"
       $include "filter-other.any"
       
      }

    # The cache section regulates what responses will be cached and where.
    /cache
      {
      # The docroot must be equal to the document root of the webserver. The
      # dispatcher will store files relative to this directory and subsequent
      # requests may be "declined" by the dispatcher, allowing the webserver
      # to deliver them just like static files.
      /docroot "/rajasthan/cache"

      # Sets the level upto which files named ".stat" will be created in the
      # document root of the webserver. When an activation request for some
      # page is received, only files within the same subtree are affected
      # by the invalidation.
      /statfileslevel "3"
      
      # Flag indicating whether to cache responses to requests that contain
      # authorization information.
      #/allowAuthorized "0"
      
      # Flag indicating whether the dispatcher should serve stale content if
      # no remote server is available.
      #/serveStaleOnError "0"
      
      # The rules section defines what responses should be cached based on
      # the requested URL. Please note that only the following requests can
      # lead to cacheable responses:
      #
      # - HTTP method is GET
      # - URL has an extension
      # - Request has no query string
      # - Request has no "Authorization" header (unless allowAuthorized is 1)
      /rules
        {
        /0000
          {
          # the globbing pattern to be compared against the url
          # example: *             -> everything
          #        : /foo/bar.*    -> only the /foo/bar documents
          #        : /foo/bar/*    -> all pages below /foo/bar
          #        : /foo/bar[./]* -> all pages below and /foo/bar itself
          #        : *.html        -> all .html files
          /glob "*"
          /type "allow"
          }
          
          /0001
          {
          /glob "/mjsa/*"
          /type "deny"
          }
          
          /0002
          {
          /glob "/content/dipr-admin/en/*"
          /type "deny"
          }
          
          /0003
          {
          /glob "/content/dipr/en/special-release.*"
          /type "deny"
          }
          
          /0004
          {
          /glob "/content/dipr/en/press-release.*"
          /type "deny"
          }
          
          /0005
          {
          /glob "/content/dipr/en/news-detail.*"
          /type "deny"
          }
          
          /0006
          {
          /glob "/content/dipr/en/advertisement/*"
          /type "deny"
          }
          /0007    
          {
         /glob "/content/dipr/en/login.*"
         /type "deny"
         }    

        /0008    {
         /glob "/content/dipr/en/newspaperratelist.*"
        /type "deny"
        }
          
        }
        
        
        /sessionmanagement
            {
                /directory "<dispatcher path>/dispatcher/htdocs/.sessions"
                /header "Cookie:login-token"
            }
        /auth_checker
              {
              # request is sent to this URL with '?uri=<page>' appended
              /url "/bin/permissioncheck"
                   
              # only the requested pages matching the filter section below are checked,
              # all other pages get delivered unchecked
              /filter
                {
                /0000
                  {
                  /glob "*"
                  /type "deny"
                  }
                /0001
                  {
                  /glob "*.html"
                  /type "allow"
                  }
                }
              # any header line returned from the auth_checker's HEAD request matching
              # the section below will be returned as well
              /headers
                {
                /0000
                  {
                  /glob "*"
                  /type "deny"
                  }
                /0001
                  {
                  /glob "Set-Cookie:*"
                  /type "allow"
                  }
                }
              }
        
        
        
        
      # The invalidate section defines the pages that are "invalidated" after
      # any activation. Please note that the activated page itself and all
      # related documents are flushed on an modification. For example: if the
      # page /foo/bar is activated, all /foo/bar.* files are removed from the
      # cache.
      /invalidate
        {
        /0000
          {
          /glob "*"
          /type "deny"
          }
        /0001
          {
          # Consider all HTML files stale after an activation.
          /glob "*.html"
          /type "allow"
          }
        /0002
          {
          /glob "/etc/segmentation.segment.js"
          /type "allow"
          }
        /0003
          {
          /glob "*/analytics.sitecatalyst.js"
          /type "allow"
          }
         /0004
          {
          # Consider all css files stale after an activation.
          /glob "*.css"
          /type "allow"
          }
        /0005
          {
          # Consider all js files stale after an activation.
          /glob "*.js"
          /type "allow"
          }            
        }

      # The allowedClients section restricts the client IP addresses that are
      # allowed to issue activation requests.
      /allowedClients
        {
        # Uncomment the following to restrict activation requests to originate
        # from "localhost" only.
        #
        #/0000
        #  {
        #  /glob "*"
        #  /type "deny"
        #  }
        #/0001
        #  {
        #  /glob "127.0.0.1"
        #  /type "allow"
        #  }
        }
        
      # The ignoreUrlParams section contains query string parameter names that
      # should be ignored when determining whether some request's output can be
      # cached or delivered from cache.
      #
      # In this example configuration, the "q" parameter will be ignored.
      #/ignoreUrlParams
      #  {
      #  /0001 { /glob "*" /type "deny" }
      #  /0002 { /glob "q" /type "allow" }
      #  }
      
      }
      
    # The statistics sections dictates how the load should be balanced among the
    # renders according to the media-type.
    /statistics
      {
      /categories
        {
        /html
          {
          /glob "*.html"
          }
        /others
          {
          /glob "*"
          }
        }
      }
    }
  }

Avatar

Level 5

if you remove /sessionmanagement and /authcheck sections, what error you are getting in your dispatcher logs ?