A module of a smart card configured to execute a command from an external device, the module comprising: a communication section operable to transmit and receive data with the external device; a first record section; a timer; and a CPU configured to: generate a session key according to the command which is received by the communication section and requires generation of the session key, wherein the session key is required for executing an application; store the generated session key in the first record section; erase the session key when a count value of the timer exceeds a threshold; and continue to hold the session key by transmitting a signal which resets the count value of the timer such that a holding period of the session key is reset, when a command of the application is received and when the CPU generates: a response which shows a result of executing the command when the CPU judges that there is the session key; a response which shows that the session key was erased when the CPU judges that there is no session key and the session key is flagged as erased; or a response which shows that the session key does not exist, when the CPU judges that there is no session key and the session key is not flagged as erased, and processing of the command of the application ends. a communication section operable to transmit and receive data with the external device; a first record section; a timer; and a CPU configured to: generate a session key according to the command which is received by the communication section and requires generation of the session key, wherein the session key is required for executing an application; store the generated session key in the first record section; erase the session key when a count value of the timer exceeds a threshold; and continue to hold the session key by transmitting a signal which resets the count value of the timer such that a holding period of the session key is reset, when a command of the application is received and when the CPU generates: a response which shows a result of executing the command when the CPU judges that there is the session key; a response which shows that the session key was erased when the CPU judges that there is no session key and the session key is flagged as erased; or a response which shows that the session key does not exist, when the CPU judges that there is no session key and the session key is not flagged as erased, and processing of the command of the application ends. generate a session key according to the command which is received by the communication section and requires generation of the session key, wherein the session key is required for executing an application; store the generated session key in the first record section; erase the session key when a count value of the timer exceeds a threshold; and continue to hold the session key by transmitting a signal which resets the count value of the timer such that a holding period of the session key is reset, when a command of the application is received and when the CPU generates: a response which shows a result of executing the command when the CPU judges that there is the session key; a response which shows that the session key was erased when the CPU judges that there is no session key and the session key is flagged as erased; or a response which shows that the session key does not exist, when the CPU judges that there is no session key and the session key is not flagged as erased, and processing of the command of the application ends. a response which shows a result of executing the command when the CPU judges that there is the session key; a response which shows that the session key was erased when the CPU judges that there is no session key and the session key is flagged as erased; or a response which shows that the session key does not exist, when the CPU judges that there is no session key and the session key is not flagged as erased, and processing of the command of the application ends.