Frank Vèssia Posted August 27, 2013 Posted August 27, 2013 Hi, I'm using a code to create fake subdomains that are pw pages. RewriteCond %{HTTP_HOST} ^(page1|page2|page3)\.example\.com$ RewriteRule (.*) /main-page/%1/$1 The code works pretty well but when i browse the subdomain i lost the session if i'm loggedin. Any idea to avoid this problem?
teppo Posted August 28, 2013 Posted August 28, 2013 See http://processwire.com/talk/topic/2376-funky-session-behaviour-in-module/?p=22396. Haven't tried this with PW and can't say for sure, though, but it looks like a good start
Frank Vèssia Posted August 28, 2013 Author Posted August 28, 2013 Tried the first solution with no luck...
adrian Posted August 28, 2013 Posted August 28, 2013 Not sure if it will work in this case, but have you tried an apache based solution: https://www.google.com/search?q=php+subdomain+session&oq=php+subdomain Some of those results suggest apache and others make use of php options. Might be something in there of use.
Frank Vèssia Posted August 29, 2013 Author Posted August 29, 2013 I tried to add the first line of this code with the other ini_set of the index.php file....no luck ini_set('session.cookie_domain', '.mydomain.com'); ini_set('session.use_cookies', true); ini_set('session.use_only_cookies', 1); ini_set("session.gc_maxlifetime", $config->sessionExpireSeconds); ini_set("session.save_path", rtrim($config->paths->sessions, '/'));
ryan Posted September 1, 2013 Posted September 1, 2013 You might try adding this to the end of your /site/config.php: $config->sessionName = "sevarf2"; session_name($config->sessionName); session_set_cookie_params(0, '/', '.mydomain.com'); 3
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now