1

How can I check a session is ended on client side or not? I am storing session Ids on a table in MySQL and I want to delete all sessions Ids (rows) if the session id does not exist.

<?php
  session_start();
?>
halfer
  • 19,824
  • 17
  • 99
  • 186
Behseini
  • 6,066
  • 23
  • 78
  • 125

2 Answers2

1

you cant! but you can get the info about how long the session will stay by checking the php system variables about the seesion time out. Send it to the frontend an then do stuff. On the other hand: php seesions are stored on the filesystem. with root access you can find them check the creation time to calculate the deletion for your db entrys. Kind regards

f b
  • 115
  • 10
-1

One of the easiest way to check the session is destroyed or not..please follow the steps: 1. Right click on your web page than go to inspect element 2. Go to Application tab 3. on the left side you will find one option namely Cookies open this. In this you will find your site URL Click on that... After clicking on the link you will see all the session of that site..

Owais Noor
  • 134
  • 10
  • 1
    This is completely unrelated to the question. Also, it's not even correct -- the cookies will only contain the session ID, not any session data. –  May 19 '18 at 21:50
  • Please Check the question properly he is asking for how he can check a session is ended on client sidet..That is Why i wrote this...From these steps he will get Session ID and automatically He will get to know that whether the Session is destroyed or Not..Hope You Understand – Owais Noor May 21 '18 at 15:17