Use example.com if you don't want the cookie to be available from sub-domains and use .example.com if you want the cookie to be available from sub-domains for $Configuration['Garden']['Cookie']['Domain'].
These settings go in the config.php file in your Vanilla's /conf folder.
@Shadowdare said:
Use example.com if you don't want the cookie to be available from sub-domains and use .example.com if you want the cookie to be available from sub-domains for $Configuration['Garden']['Cookie']['Domain'].
These settings go in the config.php file in your Vanilla's /conf folder.
So I copied these exact lines to the end of my config.php
@Shadowdare said:
That's one way to know that the new cookie settings are in effect. You have to clear the cookies of your forum from your web browser.
@Shadowdare said:
That's one way to know that the new cookie settings are in effect. You have to clear the cookies of your forum from your web browser.
Just one more question though. When I sign out the page with the script still thinks I am signed in for quite awhile. I can fix this my clearing my cache but is there anyway to remove the cookie when the user signs out so that it reacts instantly?
@gabessdsp said:
Just one more question though. When I sign out the page with the script still thinks I am signed in for quite awhile. I can fix this my clearing my cache but is there anyway to remove the cookie when the user signs out so that it reacts instantly?
The script sounds like it's reacting instantly, so it's the browser cache like you said. You just need to specify some HTML metatags to control the cache expiry of the page.
you can display photos and profile links in external web page
$Session = Gdn::Session(); // Declare an alias for the user session.
// Check if the user session is valid.
if($Session->IsValid()) {
// echo "The user is logged in!"; // The session is valid, so the user is logged in.
$UserName = $Session->User->Name;
$UserPhoto =$Session->User->Photo;
$UserSPhoto = ChangeBasename($UserPhoto, 'n%s');
$UserBPhoto = ChangeBasename($UserPhoto, 'p%s');
// display link to user profile
echo '<a href="' . PATH_ROOT . DS . 'profile">'. "My Username link to profile:" . $UserName . '</a>';
echo '<img title="userSphoto" src ="' . PATH_ROOT . DS . "uploads" . DS . $UserSPhoto .'">';
echo '<img title="userBphoto" src ="' . PATH_ROOT . DS . "uploads" . DS . $UserBPhoto .'">';
} else {
// echo "The user is not logged in."; // The session is invalid, so the user is not logged in.
// display sign in link to user profile
echo '<a rel="nofollow" href="/vanilla/entry/signin">Sign In</a>';
}
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
Comments
So do...
and if I copy and paste that.... into the where I am running the script above in the forum? Do I have to put it anywhere else?
Use
example.com
if you don't want the cookie to be available from sub-domains and use.example.com
if you want the cookie to be available from sub-domains for$Configuration['Garden']['Cookie']['Domain']
.These settings go in the
config.php
file in your Vanilla's/conf
folder.Add Pages to Vanilla with the Basic Pages app
So I copied these exact lines to the end of my config.php
$Configuration['Garden']['Cookie']['Name'] = 'Vanilla';
$Configuration['Garden']['Cookie']['Path'] = '/';
$Configuration['Garden']['Cookie']['Domain'] = 'http://.crimsonlakemc.com';
but the script you first provided me with is still not showing the user as logged in. I logged in and out several times
Don't put
http://
in your cookie domain.Add Pages to Vanilla with the Basic Pages app
errr....now It's not letting me sign out
That's one way to know that the new cookie settings are in effect. You have to clear the cookies of your forum from your web browser.
Add Pages to Vanilla with the Basic Pages app
IT WORKED!!!!!! Thank you SO much!
Just one more question though. When I sign out the page with the script still thinks I am signed in for quite awhile. I can fix this my clearing my cache but is there anyway to remove the cookie when the user signs out so that it reacts instantly?
Nevermind that seems to be a problem on my part. I'll worry about that at a later time
The script sounds like it's reacting instantly, so it's the browser cache like you said. You just need to specify some HTML metatags to control the cache expiry of the page.
Add Pages to Vanilla with the Basic Pages app
thank you so much Shadowdare , your post help me a lot
how about moving this to tutorials - it was hard to find or at least create a new tutorial in tutorials with info in this comment.
It's pretty handy.
@Shadowdare
http://vanillaforums.org/discussion/comment/195082/#Comment_195082
external session
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
if you modify shadowdare's code above.
you can display photos and profile links in external web page
$Session = Gdn::Session(); // Declare an alias for the user session.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.