Re: [PHP] Sessions just don't work on my machine. (Trying this ag ain)

2001-09-25 Thread Tamas Arpad

On Monday 24 September 2001 21:23, Thomas Deliduka wrote:
 I just tried this here below. Before trying this I changed any
 called to $PHPSESSID to session_id().

 I turned off cookies
 Loaded the page... Created session id and file:
 sess_44074d3a54862b480c3407c9eb373f77
 Contents: var1|s:8:My var 1;var2|s:8:My var 2;

 I submitted the form:

If you used the yesterday's code, then you it really doesn't work 
with turned off cookies. You have to pass the SID from page to page 
in order to keep the session:

FORM ACTION=index2.php??=SID? METHOD=POST

 PHPsessionid shows up as: 2f633e17c6752342d0c1e7e6191b4112
 New file with same name contents: var3|s:8:My Var 3;

 I removed index2.php and went back to the first file.
 PHP SessID shows up as 68b482365d9086068edfa3e35d8dd41d
 Corresponding file with contents: var1|s:8:My var 1;var2|s:8:My
 var 2;
[..]
 But it's clear to me that each time session_start() is called, it
 doesn't open the existing session rather it creates a new one.

If you just removed all things from the url, even the session id then 
it's not strange that php created a new session. Sessions works this 
way. If session_start() can't find a session id then start a new 
session, otherwise it reopens the old one, and creates the variables 
that's been stored previuosly.

 When I click the 'try this link' instead when starting over. It
 still creates a new session ID on the server.
It's really strange, and does the same for me on you server for the 
first page loading. When I reload the page again (with the old 
session id, not the newly created) the variables are read properly 
from the session (var1, var2), and are shown on the page. Somehow it 
doesn't work on the first page load, but works later.
Sorry I can't think of any other thing, but please let me know if 
something works, or changes.

Arpi


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Sessions just don't work on my machine. (Trying this ag ain)

2001-09-24 Thread Johnson, Kirk

Try these changes:

session.cookie_lifetime   = 0
session.use_trans_sid = 1

Also, what version of PHP are you using?


 My php.ini:
 
 [Session]
 session.save_handler  = files
 session.save_path = /tmp
 
 session.use_cookies   = 1
 session.name  = PHPSESSID
 
 session.auto_start= 0
 session.cookie_lifetime   = 3600
 
 session.cookie_path   = /
 session.cookie_domain =
 session.serialize_handler = php
 
 session.gc_probability= 1
 
 session.gc_maxlifetime= 1440
 
 session.referer_check = 0
 
 session.entropy_length= 0
 session.entropy_file  =
 ; session.entropy_length= 16
 ; session.entropy_file  = /dev/urandom
 session.cache_limiter = nocache
 
 session.cache_expire  = 180
 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Sessions just don't work on my machine. (Trying this ag ain)

2001-09-24 Thread Tamas Arpad

On Monday 24 September 2001 18:51, Thomas Deliduka wrote:
 I'm finding my script on www.fromtheduke.com/session/ still doesn't
 work even with the ?=SID? in the link or passing it along in the
 form.
Please send us your latest code again, then we can help you, not just 
guessing what you've might done.
Arpi

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Sessions just don't work on my machine. (Trying this ag ain)

2001-09-24 Thread Johnson, Kirk

OK, do you have access to your /tmp directory? If so, close your browser,
then open it and request your index page. Now sort the files in /tmp by
creation time, to find the newly created session file. Look at its contents,
and see if the 2 variables have values assigned to them in the file. Do this
before you click submit on index.

BTW, I don't think $PHPSESSID is ever defined on the first request. Instead,
you can do this to see the new session ID on the first page. That will also
help you find the correct session file to inspect.

echo session id is  . session_id() . br\n;

Kirk

 -Original Message-
 From: Thomas Deliduka [mailto:[EMAIL PROTECTED]]
 Sent: Monday, September 24, 2001 11:19 AM
 To: PHP List
 Subject: Re: [PHP] Sessions just don't work on my machine. 
 (Trying this
 ag ain)
 
 
 On 9/24/2001 1:18 PM this was written:
 
  OK, now the session ID is getting passed like it should. 
 Now for the two
  missing variables. Try moving the two assignment 
 statements ahead of the two
  session_register() calls - assign, then register. I have 
 never seen this
  make a difference, but the pros on this list say that is 
 the way it needs to
  be done.
  
  Done, I switched the four lines around.
 
 Same result.
 -- 
 
 Thomas Deliduka
 IT Manager
  -
 New Eve Media
 The Solution To Your Internet Angst
 http://www.neweve.com/
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: 
 [EMAIL PROTECTED]
 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Sessions just don't work on my machine. (Trying this ag ain)

2001-09-24 Thread Arpad Tamas


 Then I will reload the first page again by erasing index2.php and
 hitting enter and it will display a new sess id number and show the
 first page, as normal but that sessid number is equal t the new
 session created on the server and the value of it is:

 var3; var1; var2

 This is stranger than strange.
This isn't so strange. The session id is stored in a cookie.

But.. I turned off cookies (debuging can be done much easier), and 
played a little.
I found that the session is created properly on the first page and 
the 2 variables are registered too.
But on the second page they aren't set on the first view (that's 
stange!).
If I reload the page (of course the same sid is in the url), the 2 
variables this time are set, with their value that were given on the 
first page (that's why I told above they were registered, and their 
values are stored properly, so it's not a problem of rights, session 
save paths, etc..)
So that's what I've found, but I have to go home now sorry.
On the other hand the 2 source file you've sent me worked fine on my 
computer, without any problems (and warnings). 

Arpi

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Sessions just don't work on my machine. (Trying this ag ain)

2001-09-24 Thread Tamas Arpad

On Monday 24 September 2001 18:39, Thomas Deliduka wrote:
 On 9/24/2001 12:32 PM this was written:
  After reloading IE on the PC now the SID constant doesn't
  echo anything at
  all.
 
  SID is always defined on the first page request. It is only
  defined on later page requests if cookies are disabled in the
  browser.

 So, I shouldn't use that if I'm depending on SID to display on
 pages to pass the session ID.  Or what, disable cookie support in
 my php.ini?
No, SID constant is especially usefull when you don't know if the 
user accepts cookies or not. SID will have a real value (e.g. 
PHPSESSID=lk123s) when you should add it to the url, and will 
have an empty value when you don't need to deal with it (because it's 
been stored in cookie).
Arpi

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]