User Logged In Cookie
User Logged In Cookie
Hi,
I need to be able to check if a user is logged in or not. What is the name of the cookie you use to know that a user is logged in. Does it ever change for any reason?
rgds
stu
I need to be able to check if a user is logged in or not. What is the name of the cookie you use to know that a user is logged in. Does it ever change for any reason?
rgds
stu
Re: User Logged In Cookie
You only have to include common.php and check the variable $gValidLogin
Re: User Logged In Cookie
This is what my programmer said about this....
Also, I wasn't able to include the commons.php file they told you about in the admidio forums. Including it in other php documents causes a php error. I just don't have a way to check if the user is logged in or not as I cannot include commons.php and check for the $gValidLogin variable
What we are trying to do is check that a user is logged in to Admidio before they are allowed to send me a specific buynow/makeoffer email. If not logged in, goto admidio and register or login, if logged in, then go to the email page. We are not in the admidio system when we are trying to do this. We are trying to go to the Admidio system based on the results of the test.
Is it possible for you to be more specific about including common.php in a non-admidio php file and how to test for the logon variable?
rgds
stu
Also, I wasn't able to include the commons.php file they told you about in the admidio forums. Including it in other php documents causes a php error. I just don't have a way to check if the user is logged in or not as I cannot include commons.php and check for the $gValidLogin variable
What we are trying to do is check that a user is logged in to Admidio before they are allowed to send me a specific buynow/makeoffer email. If not logged in, goto admidio and register or login, if logged in, then go to the email page. We are not in the admidio system when we are trying to do this. We are trying to go to the Admidio system based on the results of the test.
Is it possible for you to be more specific about including common.php in a non-admidio php file and how to test for the logon variable?
rgds
stu
Re: User Logged In Cookie
Which Admidio version are we talking about? It should work to include the common.php in other projects. Could you post the php error message?
Re: User Logged In Cookie
This is what my programmer said....
The error I was getting was Error HTTP 500, but I was able to include the common.php file from another file (previously I was including it directly in the template file and was getting that error, now I tried including it from the inner workings file of the details page and I'm no longer getting the error).
But when I try to click on the BuyNow button I'm still getting the popup that I need to be registered to buy the product. Even though I am logged in. I supposed there could be a multitude of reasons for this. But let's first rule out that I am receiving the $gValidLogin variable. Where do you send it to on my system, and how should the programmer look it up?
rgds
stu
The error I was getting was Error HTTP 500, but I was able to include the common.php file from another file (previously I was including it directly in the template file and was getting that error, now I tried including it from the inner workings file of the details page and I'm no longer getting the error).
But when I try to click on the BuyNow button I'm still getting the popup that I need to be registered to buy the product. Even though I am logged in. I supposed there could be a multitude of reasons for this. But let's first rule out that I am receiving the $gValidLogin variable. Where do you send it to on my system, and how should the programmer look it up?
rgds
stu
Re: User Logged In Cookie
Sorry. I'm using the latest version of admidio. v3.2.8
Re: User Logged In Cookie
Hi Stub,
here an example. You have your own buysomething.php script.
Now you include the common.php and after that you have access in that file to $gValidLogin.
Maybe that helps a little ...
here an example. You have your own buysomething.php script.
Now you include the common.php and after that you have access in that file to $gValidLogin.
Code: Alles auswählen
<?php
include('admidio/adm_program/system/common.php'); // maybe another path in your system
... other code ...
if($gValidLogin)
{
... only code if you have a valid admidio login ...
}
Re: User Logged In Cookie
Hi Fasse,
Not to me. But it might to my programer
Please forgive me for asking an additional question. But the reason for this might be critical (for me). Because what I'm trying to achieve is this. Let's say there are five visitors to my website, which has thousands of domains for sale, or make offer. They all decide to buy a domain within say a five minute period. How do I decide which of these are logged in and can proceed to buy a domain and which ones need to be redirected to Admidio for Registration or Login. To me. As a non-programer. It seems there might be some kind of disconnect, where the login variable might get used by the wrong user. Or is that some kind of just crazy thinking? Or if it's not just crazy thinking, is there a workaround for this?
To put it another way. If the variable is going to the visitor's computer, I suppose everything is fine, provided we are checking their computer for this variable. Is that what we are doing when we are checking for the login variable?
My programer appears to be having variable success checking this login variable. Sometimes it works sometimes it doesn't. Sometimes even an http 500 error. For me. When I try it. I login to Adminio, go to buy a domain, but my system never lets me pass that check. Which could be for a multitude of reasons. I've asked him to come on here. But so far he hasn't agreed. (I keep him busy).
rgds
stu
Not to me. But it might to my programer
Please forgive me for asking an additional question. But the reason for this might be critical (for me). Because what I'm trying to achieve is this. Let's say there are five visitors to my website, which has thousands of domains for sale, or make offer. They all decide to buy a domain within say a five minute period. How do I decide which of these are logged in and can proceed to buy a domain and which ones need to be redirected to Admidio for Registration or Login. To me. As a non-programer. It seems there might be some kind of disconnect, where the login variable might get used by the wrong user. Or is that some kind of just crazy thinking? Or if it's not just crazy thinking, is there a workaround for this?
To put it another way. If the variable is going to the visitor's computer, I suppose everything is fine, provided we are checking their computer for this variable. Is that what we are doing when we are checking for the login variable?
My programer appears to be having variable success checking this login variable. Sometimes it works sometimes it doesn't. Sometimes even an http 500 error. For me. When I try it. I login to Adminio, go to buy a domain, but my system never lets me pass that check. Which could be for a multitude of reasons. I've asked him to come on here. But so far he hasn't agreed. (I keep him busy).
rgds
stu
Re: User Logged In Cookie
If you have several users on your website than the webserver will manage this. Every user get a single session and within this session the script will check the variable. So there will be no problem.