1.) Is there a way i can check if a cookie was created in a particular session?
2.) Does anyone knows the easiest way to check if a user was logged in or not before opening a page?
Printable View
1.) Is there a way i can check if a cookie was created in a particular session?
2.) Does anyone knows the easiest way to check if a user was logged in or not before opening a page?
1.To indentify that a cookie is created on particular session you first know the session id. If a user logon a particular session Id will be created this is unique id. Using this id you can verify that the cookie is creeated on this session or not.
2. TO verify a user is logged in or not, the easiest way is to create one session variable for example session("login"). Store the userId in that variable. If the session("login") is empty then you can easily identify the user is not logged in.