Author Topic: sessionid in the address  (Read 23082 times)

0 Members and 1 Guest are viewing this topic.

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
sessionid in the address
« on: May 05, 2003, 03:08:02 AM »
Just wondering, under what kind of conditions "sessionid=" shows in the address?
I noticed that on some sites it shows all the time, on my site "normaly" it shows only after u open site first time and click on any links, but next click will be without it...
but, in my logs I can see that some visitors have "sessionid=" all the time.

also, on some sites if u delete "sessionid=" from the address become logged out...

so, how does it work?
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline Jan

  • Administrator
  • 4images Guru
  • *****
  • Posts: 5.024
    • View Profile
    • 4images - Image Gallery Management System
sessionid in the address
« Reply #1 on: May 05, 2003, 10:43:07 AM »
Normally, the session id is stored in a cookie. The session id is only appended to the url, if the user has disabled cookies.

Jan
Your first three "must do" before you ask a question:
1. Forum rules
2. FAQ
3. Search

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
sessionid in the address
« Reply #2 on: May 05, 2003, 10:46:42 AM »
but then, cant we use browser's session too?
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline Jan

  • Administrator
  • 4images Guru
  • *****
  • Posts: 5.024
    • View Profile
    • 4images - Image Gallery Management System
sessionid in the address
« Reply #3 on: May 05, 2003, 10:47:56 AM »
Sorry? What do you mean with "browser's session"?

Jan
Your first three "must do" before you ask a question:
1. Forum rules
2. FAQ
3. Search

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
sessionid in the address
« Reply #4 on: May 05, 2003, 10:56:49 AM »
well, same as "images per page" working by default. it uses....wait a min...ah, I think now I understand...8O
well, I thought maybe something like shoping cart? u know, as long as browser is opened, it uses some sort of session, is there a way use it as well?
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline Jan

  • Administrator
  • 4images Guru
  • *****
  • Posts: 5.024
    • View Profile
    • 4images - Image Gallery Management System
sessionid in the address
« Reply #5 on: May 05, 2003, 11:09:21 AM »
Sorry, i'm a little bit confused. Use the session for what?  :?

Jan
Your first three "must do" before you ask a question:
1. Forum rules
2. FAQ
3. Search

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
sessionid in the address
« Reply #6 on: May 05, 2003, 11:11:15 AM »
I ment use "browser's session" to store current session...
so, that would help when cookies are disabled?
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline Jan

  • Administrator
  • 4images Guru
  • *****
  • Posts: 5.024
    • View Profile
    • 4images - Image Gallery Management System
sessionid in the address
« Reply #7 on: May 05, 2003, 11:31:55 AM »
What are "browser's session"?

Jan
Your first three "must do" before you ask a question:
1. Forum rules
2. FAQ
3. Search

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
sessionid in the address
« Reply #8 on: May 05, 2003, 11:41:03 AM »
well, maybe there is no such a thing... but for example, if u restrict one folder at the server, by using .htaccess, that will ask visitors to login, then after u logged in, it will use some sort of session that will keep u logged in untill u close the browser. So I thought maybe its possible uses same thing at 4images?
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline Jan

  • Administrator
  • 4images Guru
  • *****
  • Posts: 5.024
    • View Profile
    • 4images - Image Gallery Management System
sessionid in the address
« Reply #9 on: May 05, 2003, 11:48:31 AM »
Yes, its possible to use HTTP authentication, but it's not very comfortable (i.e. there is no real logout function possible) and not available for alle PHP installations. See: http://php.net/manual/en/features.http-auth.php

Jan
Your first three "must do" before you ask a question:
1. Forum rules
2. FAQ
3. Search

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
sessionid in the address
« Reply #10 on: May 05, 2003, 12:00:18 PM »
Quote from: Jan
but it's not very comfortable (i.e. there is no real logout function possible)

thx Jan for the info. by reading replys at that site, I think it's possible to add it into 4images...will try to play with it sometimes :D
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline Apollo13

  • Addicted member
  • ******
  • Posts: 1.093
    • View Profile
sessionid in the address
« Reply #11 on: May 07, 2003, 10:34:57 PM »
Hmmm hat mir geholfen, jetz versteh ich auch, wann de DInger angezeigt werden...

Danke

Offline bernd

  • Full Member
  • ***
  • Posts: 214
    • View Profile
sessionid in the address
« Reply #12 on: June 12, 2003, 04:29:39 PM »
Quote from: Jan
Normally, the session id is stored in a cookie. The session id is only appended to the url, if the user has disabled cookies.


Yeah, that's true but there is a slight problem (apart from the fact that the crappy IE doesn't display the SID when running without cookies ...)
I have a few static pages that are called via "index.php?template=news" for instance - they do not have a sessionID added to the URL. Is there a way that I can tell 4images to add the session ID? I tried the normally available constant SID but that doesn't work :-(

And another problem is that I have coded a few search links like "{url_search}?search_keywords=max+mustermann" - these work fine when the user has cookies enabled but with disabled cookies the parsed URL looks like this "?sessionid=804209c8f06d64fe750418662fa45346?search_keywords=max+mustermann" obviously this doesn't work; the 2nd "?" had to be replaced by "&".

Any idea how to solve these issues? I worked around the latter problem by replacing the "{url_search}" with a hard coded "./search.php". By this I lose the session ID but at least my users get proper search results. I'm now thinking about building forms with hidden fields for the search terms and to submit the form by clicking the link ...

Also one question to Jan as we are talking about sessions: why are you storing them in the database instead of PHP's default to store them in the file system? I've been told that the file system solution is quicker than database calls.

cheers,
Bernd

Offline Chris

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 4.487
  • Did u ever stop to think and then forget to start?
    • View Profile
sessionid in the address
« Reply #13 on: June 12, 2003, 05:30:41 PM »
Quote from: bernd
Also one question to Jan as we are talking about sessions: why are you storing them in the database instead of PHP's default to store them in the file system? I've been told that the file system solution is quicker than database calls.

Technically the file system is faster because web servers are optimized for delivering files off disks.  So why not store EVERYTHING on the file system instead of the database?  A database is easier to work with, more portable, allows data relationships to be stored, etc. etc.  Quite frankly the performance difference is very small.

Offline bernd

  • Full Member
  • ***
  • Posts: 214
    • View Profile
sessionid in the address
« Reply #14 on: June 13, 2003, 09:33:53 AM »
Quote from: Chris
A database is easier to work with, more portable, allows data relationships to be stored.


Yep, I agree but do you do those kind of things with the sessions? I guess not.

I'm just wondering and asked out of pure curiousity why PHP's default has been changed - no offense to anyone!

cheers,
Bernd