[Pro] PHP_PageProtect: What is 'Session ID'?

What is “Session ID” used for in this fwaction? I tried entering just numbers but it does not want that. Puzzled…

Adrian Williams

http://actionsforge.com/actions/view/255-php-pageprotect


actionsdev mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

The name of the session ID variable used by the PHP code and application server. PHP variable names (as in most languages) cannot begin with a numeral, so that’s why it hated what you entered.

Walter

On Sep 26, 2012, at 1:31 PM, Adrian Williams wrote:

What is “Session ID” used for in this fwaction? I tried entering just numbers but it does not want that. Puzzled…

Adrian Williams

http://actionsforge.com/actions/view/255-php-pageprotect


actionsdev mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


actionsdev mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

So does that variable change in the fwaction dialog or is it changed per-session by the PHP code? Don’t know how a ‘session’ is created.

Sounds like I need to have some PHP processing what is entered and checking various things. Where do I start with that - any suggestions?

Adrian Williams


actionsdev mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

At 13:31 -0400 26/9/12, Adrian Williams wrote:

What is “Session ID” used for in this fwaction? I tried entering
just numbers but it does not want that. Puzzled…

At 13:48 -0400 26/9/12, Adrian Williams wrote:

So does that variable change in the fwaction dialog or is it changed
per-session by the PHP code? Don’t know how a ‘session’ is created.

Sounds like I need to have some PHP processing what is entered and
checking various things. Where do I start with that - any
suggestions?

When you use PHP (or, I presume, similar) on your site, and you use
the server function that starts a new session (session_start() in
PHP, which I assume here) with no arguments, a new ‘session’ comes
into being. It has an ID and a storage area on the server. The
Session ID (which is just a currently unique big number) will be sent
to the browser as a cookie and when the PHP script finishes doing its
thing, whatever is in the variable $_SESSION gets saved in the server
storage area as the page gets sent.

When a submission is next made from that or an associated page, the
cookie is also sent as usual. If the PHP in the called page does a
session_start(Š) with an argument that is the Session ID from the
cookie, the $_SESSION variable gets filled with whatever was saved in
the storage area against that Session ID. So it’s a way to store
stuff between multiple calls to a page or associated pages. In
practice there are shortcuts to this.

The storage area is only kept by the server for a short time. The
time will be part of the server configuration. You will have
experienced ‘session timeout’ no doubt. That is because the server
has decided to throw away the storage area for that session. That
should give you an idea as to the time. If you need to store data for
longer, a database is needed. The data saved can be anything, from a
single value to a vast tree of information. I haven’t been able to
get a definitive answer, but I would expect that saving and
retrieving a tree of session data will use fewer resources than doing
the same to a database as a database would be doing much the same
internally (although invisibly) and there is extra overhead. As an
example, kirkhouse.co.uk saves many KB in $_SESSION between request
submissions including AJAX requests. (I haven’t been asked to
complete that site as the ownership has changed).

David


David Ledger - Freelance Unix Sysadmin in the UK.
email@hidden
www.ivdcs.co.uk


actionsdev mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Many, many thanks David for that explanation. It makes sense now. Since only a login is being done it won’t need a database. I’ll research the rest.

Cheers,
Adfrian


actionsdev mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options