Unable to share sessions between https and http

Author Message

Vincent Laemmel

Tuesday 10 May 2011 11:45:11 am

Hi,

 

I cannot share sessions between two siteaccess (http and https)

 

Here is my configuration : a single eZ Publish 4.4 instance (common database) on a linux server (Debian 5)

  • siteaccess A : https://myextranet.mydomain.com
  • siteaccess B : http://mysite.mydomain.com

(using HostMatchType=map and HostMatchMapItems in : override/site.ini.append)


Session configuration in /override/site.ini.append :
[Session]
SessionNameHandler=default
SessionNamePerSiteAccess=false

(nothing else in the specific siteaccess)

 

Use case : my user logs in the extranet (https) and switch from here to the other site (http) with an html link. This authentificated user should be connected on the site with his previous profil (sessions shared beetwen the two siteaccess).
In facts, the user is set to anonymous on the second site (and cannot see the ez publish toolbar to administrate the contents in my own case...)

 

Any information would be very helpfull ;)

 

Vincent

Marko Žmak

Wednesday 11 May 2011 12:01:49 am

What if you try to share the session between two siteaccesses both using only http? Is it working then?

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Vincent Laemmel

Wednesday 11 May 2011 1:12:17 am

Not working using http between the two siteaccess...

André R.

Wednesday 11 May 2011 1:27:00 pm

Try debugging the session cookie, 1st you seem to use different sub domain so you need to setup php.ini setting session.cookie_domain to make sure cookie can be shared. Also disable session.cookie_secure if enabled. On 4.5 and up you can control these settings from site.ini as well.

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Vincent Laemmel

Friday 13 May 2011 1:45:05 am

It works fine, thanks a lot !

 

Modifications in php.ini :

session.cookie_domain=".mydomain.com"

(session.cookie_secure=off, default value)

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 29 2025 14:41:09
Script start
Timing: Jan 29 2025 14:41:09
Module start 'layout'
Timing: Jan 29 2025 14:41:09
Module start 'content'
Timing: Jan 29 2025 14:41:09
Module end 'content'
Timing: Jan 29 2025 14:41:09
Script end

Main resources:

Total runtime0.0158 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0050 588.3828151.2422
Module start 'layout' 0.00500.0026 739.625036.7188
Module start 'content' 0.00760.0067 776.343895.0156
Module end 'content' 0.01430.0015 871.359433.9766
Script end 0.0158  905.3359 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002414.9121140.0002
Check MTime0.00116.9784140.0001
Mysql Total
Database connection0.00074.342810.0007
Mysqli_queries0.002415.417030.0008
Looping result0.00000.088910.0000
Template Total0.00117.010.0011
Template load0.00095.682510.0009
Template processing0.00021.244710.0002
Override
Cache load0.00064.077610.0006
General
dbfile0.003018.741180.0004
String conversion0.00000.039240.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs