Can someone explain how sessions work in embedded mode so I can resolve problems?

toastmaster

Joined: 2003-05-01
Posts: 219
Posted: Fri, 2006-05-19 09:07

When I FIRST visit my site, via a direct link to an embedded album, it kicks me back to the main page. But it then adds a session variable, eg:
http://www.digitaltoast.co.uk/blog/index.php?g2_GALLERYSID=3a6bXXXXX6824f8b9d0aae0bd995d417
to my gallery, which is then removed on the NEXT click, which then works.

I'm wondering now about what the different type of sessions mean, and how gallery works etc.

For example, from other postings, it seems that Gallery should have it's own sessions directory somewhere under my "root level" g2albums.
I don't see this anywhere. All I can find is my normal sessions folder, configured in php.ini

With the cookies section setup to be / and .digitaltoast.co.uk in gallery, if I look in cookies in my browser, I get:
www.digitaltoast.co.uk PHPSESSID xxxx
digitaltoast.co.uk GALLERYSID xxxx

If I delete both cookies, then refresh the page, then the whole lot is appended to the url!
http://www.digitaltoast.co.uk/blog/v/americas/?g2_GALLERYSID=XXXXXbb7669eef923c95587ebd0487&PHPSESSID=XXXXXcb76c83a5195c20ca22fd8513c

NOW - if I blank out the cookies section in the galleries preferences, then all I get under digitaltoast.co.uk is the google analytics cookies, and under www.digitaltoast.co.uk I now have "PHPSESSID" and "blog GALLERYSID", neither of which bear any relation to what's in the session directory.

The WPG2 people have told me that this is nothing to do with WPG2, and when running gallery in standalone mode, this doesn't happen. If I could get more info about how sessions in embedded mode work, then perhaps I could try and resolve this.

Gallery version = 2.1.1 core 1.1.0.1
PHP version = 5.1.2 cgi
Webserver = Apache/1.3.34 (Unix) mod_fastcgi/2.4.2 mod_gzip/1.3.26.1a mod_auth_passthrough/1.8 mod_log_bytes/1.2 mod_bwlimited/1.4 FrontPage/5.0.2.2635 mod_ssl/2.8.25 OpenSSL/0.9.7a PHP-CGI/0.
Theme: Vslider2
Integration: WPG2

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Wed, 2007-08-01 16:23

I don't really understand what the problem is, but I can tell you this: Gallery tries to determine whether your browser allows cookies.. when you first visit G2 there is no cookie, so G2 is uncertain if you don't allow cookies or just don't have one yet. So it sends back a cookie AND adds the session id to URLs on that page. When you click a link the next request will either get the cookie (now G2 sees you allow cookies and won't add the sessionid to all the URLs anymore) or if cookies aren't allowed then it gets the sessionid from the URL and will continue adding the id to future URLs.