Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Community » Newbie corner » sessions in Skylark
Re: sessions in Skylark [message #38444 is a reply to message #38375] Sun, 16 December 2012 00:32 Go to previous messageGo to previous message
Peter is currently offline  Peter
Messages: 16
Registered: October 2012
Promising Member
Thank you for your reply, Honza. My general knowledge about sessions and cookies is very limited - I know what they are and what they're used for, but I've never used them before (from a developer's point of view). Here's what I want to know:

1. Suppose I have a web portal that requires users to log in in order to gain access. Now, when a user is logged in, I would like him/her to get logged out after some fixed period of time during which he/she is inactive (doesn't toggle between pages). To be more precise, let's assume my web portal consists of 3 pages: a.html, b.html and c.html. Now, if a user is on one of those pages and refreshes it or moves to another one before 15 minutes have passed, then the current session is sustained for 15 more minutes (or another one is set - will it make any real difference?). If a user stays idle for 15 minutes or more, the current session expires and he/she gets logged out. Additionally, if the user clicks on a "log out" button, current session expires/gets cleared immediately. How can I do that in Skylark?

2. I seem to confuse session, session id and session variables.
I always thought session was just some file stored on server.
When session is created, two things happen: a session file is created on server and a cookie with some unique id session identifier (set automatically, not by me) is created on client.
Cookie needs to contain only the id while session usually contains some more information about client, such as his password etc. When session expires, session file is removed from server and corresponding cookie is removed from client. Is that how it works (more or less)? Now, using Skylark terminology:

- "session" = file stored on server
- "session id" = unique identifier corresponding to a given session, stored in cookie on client
- "session variable" - a variable defined in Skylark application, its value is stored in session file on server

Is my reasoning right?

Now let's assume I need to keep track of two things for any given user:

- is the user logged (is his/her session active)
- the user privileges (is he/she a portal admin and/or subadmin)

Of course this information must be passed between different pages of my website. I thought I should set 3 variables with SessionSet(): .SESSION (is the current user logged in), .ADMIN (is the current user an admin), .SUBADMIN (is the current user a subadmin), but now I don't think it's right - this sets three different sessions, doesn't it? Or does it just set one session and three variables storing values associated with that session?

3. Is there any way to read session id for currently logged users from within Skylark application?


Best regards,
Peter

[Updated on: Sun, 16 December 2012 00:33]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Previous Topic: docEdit /lineEdit to array
Next Topic: Compile for Unix on Windows?!?!?!?
Goto Forum:
  


Current Time: Sun Aug 24 22:07:43 CEST 2025

Total time taken to generate the page: 0.05171 seconds