eZ Community » Forums » General » Randomly redirect to login page
expandshrink

Randomly redirect to login page

Randomly redirect to login page

Friday 22 May 2015 4:13:19 pm - 5 replies

Randomly, ezpublish redirect to login page on backend web page when switching between pages ??

what can i do ?

 

how ezpublish manage sessions?

Wednesday 27 May 2015 11:57:15 am

Hello mourad,

Welcome to the eZ Community!

In short we need much more information about your specific eZ Publish installation configuration / details to be able to give good answers / direction to your question.

Question #1: What version of eZ Publish are you using?

Question #2: What version of PHP are you using?

Question #3: What OS are you using?

Question #4: Have you overridden or changed any of the default site.ini session related settings?

Question #5: What session handler are you using? The default in current versions of eZ Publish Legacy is 'ezpSessionHandlerPHP' and is used by default when site.ini (and all siteacccess overrides) are set to [Session] Handler= (the default settings value). Remember that the 'ezpSessionHandlerDB' session handler is deprecated and no longer used by default.

Question #6: How long (in seconds / minutes / etc) from initial login to being asked to login again (re: login redirection)?

Question #7: Is the user checking the box on the admin siteaccess login page titled, 'Remember Me'? This is an important question to answer because it directly affects the users session timeout, which is indirectly what your asking about / having a problem with. Either way this answer affects which code / settings affect the session timeout. 

Question #7: Have you customized the php.ini setting 'session.cookie_lifetime' ? What is the current value for the server and virtual host instance? The default is 0 which means until the web browser is closed. This value is used by default when the 'Remember Me' feature is used within a pure legacy context / vhost.

Question #8: Are you running the ezpublish cronjob, 'clearsessions'?

Question #9: What is your global and admin siteaccess site.ini.append.php settings value for [Session] SessionTimeout ? This is also a very important setting value.

I also found these older but related threads: http://share.ez.no/forums/install-configuration/being-logged-out-constantly-session-cookie-trouble

http://share.ez.no/forums/install-configuration/never-getting-logged-out-from-admin-site

I hope this helps!

Cheers,
Heath

Friday 05 June 2015 12:22:42 pm

firstly thank you so much for your replay .

my answers : 

Question #1: Ez Publish 4.7

Question #2: PHP 5.3.3

Question #3: Centos 7.1

Question #4: i d'ont have session configuration

Question #5: how can i setting ezpSessionHandlerDB in ezpublish 4.7 ?

Question #6: 1 seconde ?

Question #7: yes 

Question #7: session.cookie_lifetime = 0

Question #8: Are you running the ezpublish cronjob, 'clearsessions'?

Question #9: [Session] SessionNameHandler=custom

 

for more information, we use balancer manager in our architecture, two instance of project in separate server and balancer manager.

in general, like this architecture : https://wiki.magnolia-cms.com/dow...icationDate=1248798057000&api=v2

Modified on Friday 05 June 2015 12:53:58 pm by mou mou

Friday 05 June 2015 12:49:24 pm

after login in ez publish backend, and when we click on a page user redirected to an other backend. this is the problem

Modified on Friday 05 June 2015 1:22:40 pm by mou mou

Monday 08 June 2015 6:52:24 am

Hello mou,

Thank you for your answers! Your specific responses are very helpful.

Question #10: Are you using eZ Publish in Cluster mode?

If your not using cluster mode, this is exactly why your probably having session (among many other) problems.

See: you could be logging into one server but then your next request response could (and probably is) coming from the other server where your not logged in (since sessions are not shared between servers by default).

https://doc.ez.no/eZ-Publish/Technical-manual/5.x/Features/Clustering/(language)/eng-GB

Since eZ Publish 4.4 the default session handler has been changed from the internal eZ Publish DB session handler to the PHP based session handler which means that the sessions are no longer stored with the database and are specific to each individual server's PHP installation which again is why your sessions would not be shared between servers by default.

https://github.com/ezsystems/ezpublish-legacy/blob/master/doc/bc/4.4/changes-4.4.0.txt#L40

This question (in general) came up long ago and some suggestions were made:

http://share.ez.no/forums/install-configuration/upgrade-to-4.4-on-cluster-and-session/(language)/eng-GB

The first recommendation was to use the older, 'ezpSessionHandlerDB'  session handler when running cluster installations: https://github.com/ezsystems/ezpublish-legacy/blob/master/doc/features/4.4/session_enhancement.txt#L17

Alternatively, while not recommended or perfect by any means some users have reported and shared in detail their limited successes using memcache for cluster shared session storage: http://share.ez.no/forums/discussions/ez-session-using-memcached-performance

Note: While it may not give specific answers I did find a similar (though newer version of eZ based) question: http://share.ez.no/forums/ez-publish-5-platform/constantly-losing-session-for-logged-in-user

In closing, I recommend you switch to using the 'ezpSessionHandlerDB' session handler. You can make this change by editing your 'settings/override/site.ini.append.php' file and adding the following section:

[Session]
Handler=ezpSessionHandlerDB
ForceStart=enabled

https://github.com/ezsystems/ezpublish-legacy/blob/master/settings/site.ini#L164

Then clear all caches!

Note: I've not covered proper eZ Publish Cluster mode conversion at this point but I strongly encourage you to use it if your not already!

I hope this helps!

Cheers,
Heath

Modified on Monday 08 June 2015 6:52:52 am by // Heath

Tuesday 09 June 2015 1:14:32 am

thanks, I will do that

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from