Asked  7 Months ago    Answers:  5   Viewed   30 times

I would like to make my website to allow only one session at a time. For example, let say user has login to my website on firefox, if the user login again to another browser like opera on the same computer or different computer, the session on firefox will be destroyed. However, the session on firefox remained if it remains as one session. May I know how can I do that? I am using php and apache. Thank you.

Regards. Benjamin

 Answers

28

I'll suggest you to do something like this:

Suppose when user "A" loges in to the "Com_1", for the first time. Save a unique code in the database against that session, and same with the user session.

At the mean time if he (user "A") loges in again on "com_2", then check his status in the database and update the unique code in the database.

again back if same user (user "A") refreshes the page on "com_1", we all you need to do is check the unique code from the session and match it to the database, It is for sure it will not match, then log it out and destroy the session.

For keeping the user loggedin, even if browser is closed, you can store the cookie on the browser, and re-generate the session accoordingly.

Hope this helps. Thank you.

Wednesday, March 31, 2021
 
PLPeeters
answered 7 Months ago
86

You should point to your vendor/autoload.php at Settings | PHP | PHPUnit when using PHPUnit via Composer.

This blog post has all the details (with pictures) to successfully configure IDE for such scenario: http://confluence.jetbrains.com/display/PhpStorm/PHPUnit+Installation+via+Composer+in+PhpStorm

Related usability ticket: http://youtrack.jetbrains.com/issue/WI-18388

P.S. The WI-18388 ticket is already fixed in v8.0

Wednesday, March 31, 2021
 
ojrac
answered 7 Months ago
90

I did this yesterday using mod_auth_kerberos. Basic process is as follows:

  1. Install kerberos and configure

  2. On active directory create a new user

  3. Use ktpass on windows to create a keytab

  4. Copy keytab to ubuntu and configure apache to use keytab

Have a look at the documentation here: http://www.grolmsnet.de/kerbtut/. It explains the configuration files better than I ever could.

Ubuntu specific bits are probably just installation, for which you'll want:

sudo apt-get install krb5-user libapache2-mod-auth-kerb
Wednesday, March 31, 2021
 
capsid
answered 7 Months ago
97

You aren't remembering to reset the accessory type for dequeued cells.

This should fix it for you;

  cell.accessoryType = UITableViewCellAccessoryNone;

  if (indexPath.row == index) {
            cell.accessoryType = UITableViewCellAccessoryCheckmark;
  }

Handy tip : You may find it useful to use switch(indexPath.section) rather than lots of if ... elseif ... else constructs. Although you're OK now with just 2 sections, I find that using switch makes it easier to scale up the number of sections and also makes it mentally easier to read throught the code since you often have if .. else constructs used for other things - having the different syntax helps make it clearer what the tests are for.

Sunday, August 15, 2021
 
Slinky
answered 3 Months ago
90

How about this - fiddle:

<input type="checkbox" class="chk" />
<input type="checkbox" class="chk" />
<input type="checkbox" class="chk" />
<input type="checkbox" class="chk" />

$('input.chk').on('change', function() {
    $('input.chk').not(this).prop('checked', false);  
});

Edit: for second part of your question to un-check other checkboxes when selecting parent checkbox see this fiddle - (as per chat) :

if (!cb.checked) { 
$('#trchkOptions input[type=checkbox]').attr('checked', false); 
}
Tuesday, August 31, 2021
 
arsena
answered 2 Months ago
Only authorized users can answer the question. Please sign in first, or register a free account.
Not the answer you're looking for? Browse other questions tagged :