Increment session variable by one

Posted by luckytaxi on Stack Overflow See other posts from Stack Overflow or by luckytaxi
Published on 2010-03-10T19:43:46Z Indexed on 2010/03/29 4:33 UTC
Read the original article Hit count: 334

Filed under:

How the heck do I increment a variable that's inside a session? If I declare $attempt, each time a user unsuccessfully attempts to login, I want $attempt to increase by 1. In the event it gets to 3, display a captcha.

This doesn't seem to work. :-P

$this->session->set_userdata('attempt',$this->attempt++);

© Stack Overflow or respective owner

Related posts about codeigniter