Determine if sessions are enabled client-side
NickName:Categle Ask DateTime:2012-06-08T07:31:42

Determine if sessions are enabled client-side

How can I determine, if client browser supports sessions?

I'm working on a anti-flood script - I want to limit the operations on the script to 5 seconds for each operation, and I want to store the unix time using the client sessions, but first I'd have to check if they're enabled. Is that possible to do that?

Copyright Notice:Content Author:「Categle」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/10941272/determine-if-sessions-are-enabled-client-side

Answers
Bart Wegrzyn 2012-06-07T23:40:09

I'm assuming you're trying to limit the script from running more than once every 5 seconds per client.\n\nHttp is a stateless protocol, and PHP relies on a cookie value (or parameter value) to initialize the session on the server side. Knowing this, using sessions alone is not enough to stop users from flooding your script more than once every 5 seconds. The user client could simple not send the cookie or session ID parameter in the request, and you would have to treat it like a new session.\n\nYou will have to use other methods of identifying user sessions. Using the requesting IP address is a good start, but may not work very well for you (especially since many users can have the same public facing IP). ",


More about “Determine if sessions are enabled client-side” related questions

Determine if sessions are enabled client-side

How can I determine, if client browser supports sessions? I'm working on a anti-flood script - I want to limit the operations on the script to 5 seconds for each operation, and I want to store the...

Show Detail

Determine if ASP.NET Sessions are enabled

What is the best way to do a boolean test in C# to determine if ASP.NET sessions are enabled? I don't want to use a try-catch block and Sessions != null throws an Exception. Regards.

Show Detail

Determine if sessions are enabled on an Azure Service Bus Queue

Is there a way in C# to programmatically determine if sessions are enabled on an Azure ServiceBus Queue? I am using the Azure.Messaging.ServiceBus. I can see the older version has a way of determ...

Show Detail

Flask client-side sessions

Starting to learn Python's Flask web app framework, still on the learning curve, so please bear with me. I am wondering how appropriate are the client-side sessions for secure web application purp...

Show Detail

Determine user sessions in Mysql

how can I determine the session times of these fictitious users? As an example, for user 1 I assume that between 08:24:08 and 15:08:20 he wasn't there, so I don't add that time interval, I add the ...

Show Detail

How to determine if ASAM is enabled?

I want to be able to determine if it's safe to attempt to enable ASAM mode. To determine this, it would be helpful if I could tell if SAM is enable, or ASAM is already enabled, or, in general, which

Show Detail

How to check if sessions are on

What is the easiest way in PHP to determine whether or not sessions are enabled in the php.ini file for the server. I am looking to make a pre-installation check for my PHP app and just need someth...

Show Detail

Check if cookies are enabled without setting GET parameter or sessions in PHP

Much like the question asked in Detect if cookies are enabled in PHP and Check if cookies are enabled I'd like to know if cookies are enabled. I am, however, trying to make this as transparent as

Show Detail

Sessions enabled - do we have to clean them up ourselves?

When we turn sessions on in google app engine like: // appengine-web.xml <sessions-enabled>true</sessions-enabled> does app engine automatically clean up expired sessions, or do we ha...

Show Detail

Determine whether or not ELMAH is enabled?

How can I determine programmatically whether or not ELMAH is enabled?

Show Detail