Author |
Topic  |
gary b
Junior Member
 
USA
267 Posts |
Posted - 28 May 2007 : 10:12:54
|
quote: Now, in order for session variables to work, the client needs to be able to accept cookies as that's part of how the server makes sure you're the same person. That's why I was trying to troubleshoot the cookie issue first - without cookies the session variables will never work.
Sorry... I disagree. Session variables are created on and held by the server and, as such, do not require cookies to be enabled on the browser client. (Session variables typically last as long as the User does not log off OR until the "session" -- browser window -- is closed.) However, if the creation of the session variable by the server is triggered by Snitz code that first requires a cookie, then AnonJr's statement (about needing cookies for session variables ) applies. Additionally, if the Snitz code requires BOTH a cookie and a session variable, then losing one will sabotage the 'login'.
So -- strictly speaking -- cookies are not required for Session Variables functionality. |
 |
|
AnonJr
Moderator
    
United States
5768 Posts |
Posted - 28 May 2007 : 10:28:57
|
Sorry, see the second link I posted, or get it from the horse's mouth - Session variables require cookies. With HTTP being a stateless protocol, its the only way it could work. |
 |
|
ruirib
Snitz Forums Admin
    
Portugal
26364 Posts |
Posted - 28 May 2007 : 10:37:30
|
quote: Originally posted by gary b
Sorry... I disagree. Session variables are created on and held by the server and, as such, do not require cookies to be enabled on the browser client. (Session variables typically last as long as the User does not log off OR until the "session" -- browser window -- is closed.) However, if the creation of the session variable by the server is triggered by Snitz code that first requires a cookie, then AnonJr's statement (about needing cookies for session variables ) applies. Additionally, if the Snitz code requires BOTH a cookie and a session variable, then losing one will sabotage the 'login'.
So -- strictly speaking -- cookies are not required for Session Variables functionality.
I am sorry, but I am afraid you are wrong. Servers have no way to identify who you are, so ASP requires browser cookie support. When a new request is made by a new browser, a new session is created by the server and an ID assigned to it. This ID is sent to the browser as a cookie, so that subsequent requests can be related to the same request. So, in fact, sessions require cookie support by browsers.
P.S.: Didn't catch your reply Mark, but will still leave mine ;). |
Snitz 3.4 Readme | Like the support? Support Snitz too |
 |
|
gary b
Junior Member
 
USA
267 Posts |
Posted - 28 May 2007 : 11:46:52
|
Thanks for the correction, ruirib... and you too AnonJr (I did miss your second post)
So it appears that both are needed for the use of Session Variables. Thanks for clearing up my misconception! Hopefully matko will catch your corrections.
gary b
|
Edited by - gary b on 28 May 2007 11:51:31 |
 |
|
matko
New Member

54 Posts |
Posted - 28 May 2007 : 12:30:26
|
Thank you for your explanation. Now I have some more questions.
Does the forum code check cookies every time I open/reload page or only first time to set up session variables?
Now what is the relaton between cookie that is not supposed to expire and session variables, that expire with the end of the session? I mean, if forum finds that session variables are empty, will it check cookie again, or will it consider session as ended? |
 |
|
AnonJr
Moderator
    
United States
5768 Posts |
Posted - 28 May 2007 : 22:26:43
|
The bulk of the code you are looking for is in inc_header.asp. The forum checks for the session variables and the cookie at every page load. If it doesn't find the session variables, it looks for the cookie the forum set. Usually session variables expire when you close the browser or if 30 min. go by with no further requests from you. (this is configurable, but most people leave it at 30 min.) |
 |
|
matko
New Member

54 Posts |
Posted - 29 May 2007 : 01:21:23
|
AntonJr, that's very interesting. Now let's think what maight be the cause for cookie to expire, even if it is set not nt expire.
Current beaviuor of the forum is that if you log in, independently on Remember password option, you end up logged off in certain time, doesn't matter what you do. However, when you close your browser before this happen and come back let's say few hours later you are still logged in.
According to what was written in this topic it looks like that for some reason forum is reading cookies properly at the beginning of the session, but once the session expire while you are still browsing (should this be happening?), it ignores cookies. |
Edited by - matko on 29 May 2007 01:23:30 |
 |
|
AnonJr
Moderator
    
United States
5768 Posts |
Posted - 29 May 2007 : 06:06:08
|
I still have a strong suspicion that the main problem is with cookies on the client. But, just to rule out some of the simple stuff:
- Have you asked your host if session variables are enabled? (some hosts disable them to decrease overhead) - Have you checked with Image to see if other people are having the same problem? - Have you made further modifications above and beyond what Image has done? |
 |
|
gary b
Junior Member
 
USA
267 Posts |
Posted - 29 May 2007 : 08:14:36
|
quote: Current beaviuor of the forum is that if you log in, independently on Remember password option, you end up logged off in certain time, doesn't matter what you do. However, when you close your browser before this happen and come back let's say few hours later you are still logged in.
When you re-open browser after few hours, how do you know you are not viewing cached page? Did you 'refresh' upon re-opening browser and observe that you are still 'logged in'? |
 |
|
matko
New Member

54 Posts |
Posted - 29 May 2007 : 12:28:59
|
AntonJr: I have found one topic in this forum (see my first post) that is reporting the same problem independently of Image's version. Plus Image's version is working properly on my standalone win2000 server. I'll ask my provider about session varibales, but if they are disabled I wouldn't be able to log in at all, would I? I did some minor changes, but this problem was here before them and it is not any worse.
gary b: I haven't reloaded immediately, but I browse forum and still remain logged in. |
Edited by - matko on 30 May 2007 04:26:40 |
 |
|
HuwR
Forum Admin
    
United Kingdom
20600 Posts |
Posted - 30 May 2007 : 04:45:32
|
matko,
1) we do not support Images version, if you have a problem with a modded forum supplied by a third party then you should request support from them not us. 2) if you have the same version working on one site but not another, then it is the server that is at fault not the code so you should be contacting your host not us. |
 |
|
Topic  |
|