Welcome to Geeklog, Anonymous Saturday, November 30 2024 @ 11:44 am EST

Geeklog Forums

Cookie Expiration


Status: offline

squatty

Forum User
Full Member
Registered: 01/21/02
Posts: 269
This is a multi part question regarding GL cookies and more to the point GL user authentication. Dirk feel fee to give me a verbal beating for even asking such a question ;-) 1) How/where would I go about setting the cookie to "not expire" (or expirers 365 days from issue date, ect…) 2) What setting the cookie to "not expire" result in users being auto logged in (assuming users do not delete his/here cookies)? Meaning, user X logs in once and remains logged in upon subsequent visits? My objective here is to keep users logged into my site at all times. Thnx!
In a world without walls and fences, who needs Windows and Gates?
 Quote

Status: offline

squatty

Forum User
Full Member
Registered: 01/21/02
Posts: 269
Looks like I need to revisit my 1st grade spelling book ;-) That's the last time I post a story before 7:00 AM...and yes I was thinking about this question in my sleep.
In a world without walls and fences, who needs Windows and Gates?
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
I'm not too familiar with the details of Geeklog's session handling, so take this with a grain of salt (and read the source if in doubt): 1) As you may (or should?) know, every user can set the cookie timeout in his/her Account Information - up until 1 year. 2) This does not mean that they will be logged in for a year, but only that the browser will store the cookie for a year. This is where Geeklog's session handling kicks in, since it will "forget" the user after a certain amount of time (and inactivity). However, when they visit the site again after the session has expired, the browser will send the cookie it still has and the user is immediately recognised and logged in again. For the implementation details, you'd better have a look at the source, especially at lib-sessions.php As for the "never expires" option: I don't think you can have a cookie that never expires - the specification specifically asks for an expiration date/time for cookies and if you leave that off, it only means that the cookie expires when you close your browser. bye, Dirk
 Quote

Status: offline

squatty

Forum User
Full Member
Registered: 01/21/02
Posts: 269
Thanks Dirk, I hate to admit it but, I wasn't aware of the user cookie settings. I found what I was looking for in the code and have made the appropriate adjustments (at least I think). Thanx!
In a world without walls and fences, who needs Windows and Gates?
 Quote

All times are EST. The time is now 11:44 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content