shii
(Evil Evo)
April 5, 2013, 5:34pm
1
Hello everybody,
I am trying to write a bookmarklet like Instapaper or Pocket(Read it later) uses in order to transfer data of the current page to my app.
When I click on the bookmarklet I insert this Javascript Snippet in to the header of the current site (could be any website):
<script src="http://mysite.com/index.php?r=entries/submits&u=http%3A%2F%2Fwww.google.com%2F&t=Google">
With this snippet i am able to connect to my controller which will return Javascript code:
public function actionSubmits()
{
if(Yii::app()->user->isGuest){
echo 'alert("not logged in");';
return;
}
...
}
Now the Problem is, although I am logged in as a user I always get alerted that i am not logged in which means that Yii::app()->user->isGuest returns true although I am logged in. Why is that so?
Any help would be greatly appreciated.
hiral23790
(Hiraldarji237)
April 5, 2013, 6:45pm
2
shii:
Hello everybody,
I am trying to write a bookmarklet like Instapaper or Pocket(Read it later) uses in order to transfer data of the current page to my app.
When I click on the bookmarklet I insert this Javascript Snippet in to the header of the current site (could be any website):
<script src="http://mysite.com/index.php?r=entries/submits&u=http%3A%2F%2Fwww.google.com%2F&t=Google">
With this snippet i am able to connect to my controller which will return Javascript code:
public function actionSubmits()
{
if(Yii::app()->user->isGuest){
echo 'alert("not logged in");';
return;
}
...
}
Now the Problem is, although I am logged in as a user I always get alerted that i am not logged in which means that Yii::app()->user->isGuest returns true although I am logged in. Why is that so?
Any help would be greatly appreciated.
write return false; otherwise remove return from there.
shii
(Evil Evo)
April 6, 2013, 11:11am
3
that won’t make any difference.
I am using echo and not return for transfering data to the Javascript Snippet
I am using return to stop the current execution
Yii still identifies me as a guest although i am logged in
Any other suggestions?