How can I get _s in browser URL when using #initialRequest: / cookies / ajax

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

How can I get _s in browser URL when using #initialRequest: / cookies / ajax

Mariano Martinez Peck
Hi guys, 

I am adding "Remember Me" kind of feature in my seaside app. I have my root seaside class that implements #initialRequest:. If there was a correct cookie, then I do not even render a login page and instead in the #go: of my root class I directly #call: my main app component. 

The problem I have is that when a user is logged in from a cookie, and my main app component is called (there is no click from the user, no callback) , the _s is not in the browser URL.  And all my main menu and everything from my app is done with ajax. In the past, I found an issue that AJAX callabacks would not trigger #updateRoot:. So...you can click menus, do stuff, and still, no _s in browser URL. This is a problem because a user could, for example, do a CMD+R and then it gets the welcome page again loosing it's session.

Of course, as soon as I click a button or something that does a normal callback (not ajax), then the URL gets the _s. But I need to do this from the very beginning. 

Also..the session does answer correct to #url. The problem is about refreshing the browser's URL. 

So... is there a way I can hack in order to re-render something so that _s is added to the browser URL?  I have an idea in mind but it's a terrible hack... 

Thanks for any help, 

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: How can I get _s in browser URL when using #initialRequest: / cookies / ajax

Sabine Manaa
Hi Mariano,

when I read your post, I hat the idea that you could (mis)use this:
https://developer.mozilla.org/de/docs/Web/Guide/DOM/Manipulating_the_browser_history

Possibly this is rubbish, it is only an idea. I use it for back button functionality, described here
http://forum.world.st/How-did-you-solve-the-ajax-amp-back-browser-button-problem-td4759490.html#a4760722

In the first moment reading your post, I thought, oh, I would make this, too. But I think my users would be irritated if the login page would not appear.

Regards
Sabine

Reply | Threaded
Open this post in threaded view
|

Re: How can I get _s in browser URL when using #initialRequest: / cookies / ajax

Johan Brichau-2
In reply to this post by Mariano Martinez Peck
Hi Mariano,

Did you try implementing that with the #updateUrl: on your app component?

Johan

On 29 Sep 2015, at 20:24, Mariano Martinez Peck <[hidden email]> wrote:

Hi guys, 

I am adding "Remember Me" kind of feature in my seaside app. I have my root seaside class that implements #initialRequest:. If there was a correct cookie, then I do not even render a login page and instead in the #go: of my root class I directly #call: my main app component. 

The problem I have is that when a user is logged in from a cookie, and my main app component is called (there is no click from the user, no callback) , the _s is not in the browser URL.  And all my main menu and everything from my app is done with ajax. In the past, I found an issue that AJAX callabacks would not trigger #updateRoot:. So...you can click menus, do stuff, and still, no _s in browser URL. This is a problem because a user could, for example, do a CMD+R and then it gets the welcome page again loosing it's session.

Of course, as soon as I click a button or something that does a normal callback (not ajax), then the URL gets the _s. But I need to do this from the very beginning. 

Also..the session does answer correct to #url. The problem is about refreshing the browser's URL. 

So... is there a way I can hack in order to re-render something so that _s is added to the browser URL?  I have an idea in mind but it's a terrible hack... 

Thanks for any help, 
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside


_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: How can I get _s in browser URL when using #initialRequest: / cookies / ajax

Mariano Martinez Peck


On Thu, Oct 1, 2015 at 9:16 AM, Johan Brichau <[hidden email]> wrote:
Hi Mariano,

Did you try implementing that with the #updateUrl: on your app component?


Hi Johan,

Thanks for the idea. At the end, I also needed a component for when a user was authenticated directly from "remember me" cookies. You know, a component showing "you will be logged with username XXX, continue or log with another user". So this component has the side effect of having a callback and hence displaying the _s in the browser URL for the following #call: which was my main app component.  

Thanks anyway!
 
Johan

On 29 Sep 2015, at 20:24, Mariano Martinez Peck <[hidden email]> wrote:

Hi guys, 

I am adding "Remember Me" kind of feature in my seaside app. I have my root seaside class that implements #initialRequest:. If there was a correct cookie, then I do not even render a login page and instead in the #go: of my root class I directly #call: my main app component. 

The problem I have is that when a user is logged in from a cookie, and my main app component is called (there is no click from the user, no callback) , the _s is not in the browser URL.  And all my main menu and everything from my app is done with ajax. In the past, I found an issue that AJAX callabacks would not trigger #updateRoot:. So...you can click menus, do stuff, and still, no _s in browser URL. This is a problem because a user could, for example, do a CMD+R and then it gets the welcome page again loosing it's session.

Of course, as soon as I click a button or something that does a normal callback (not ajax), then the URL gets the _s. But I need to do this from the very beginning. 

Also..the session does answer correct to #url. The problem is about refreshing the browser's URL. 

So... is there a way I can hack in order to re-render something so that _s is added to the browser URL?  I have an idea in mind but it's a terrible hack... 

Thanks for any help, 
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside


_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside




--

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside